From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jos Delbar Subject: Re: Re: Linux ACPI processor driver patch: user-definable power state limit Date: Sat, 6 Nov 2004 00:39:27 +0100 Message-ID: <200411060039.28067.jos.delbar@ugent.be> References: <1099683907.13837.1353.camel@d845pe> <20041105225438.GA8262@dominikbrodowski.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20041105225438.GA8262-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org> Content-Disposition: inline Sender: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Dominik Brodowski Cc: Len Brown , ACPI Developers , Robert Moore , James P Ketrenos List-Id: linux-acpi@vger.kernel.org Is it safe to return a pointer to an internal module structure? I think a bad driver could potentially ruin the linked list by changing the next pointer. On Friday 05 November 2004 23:54, Dominik Brodowski wrote: > That sounds to be quite racy. Multiple callers will get confused. > You probably need a > > struct acpi_cstate_limit { > list_head next; > unsigned int limit; > } > > and you export > > struct *acpi_cstate_limimt acpi_set_cstate_limit(unsigned int limit); > > int acpi_modify_cstate_limit(struct acpi_cstate_limit * cstate_limit); > > void acpi_remove_cstate_limit(struct acpi_cstate_limit * cstate_limit); > > Whenever such an operation occurs, you need to walk all these limit structs > for the highest "limit", and use that. -- Jos Delbar jos.delbar-Cru1EgDzd7c@public.gmane.org ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click