Thread (1 message) 1 message, 1 author, 2003-09-02

Re: [ACPI] acpi_bus_register_driver() returns -ENODEV after resume

From: Karol Kozimor <hidden>
Date: 2003-09-02 23:22:08

Thus wrote Patrick Mochel:
Since it's __initdata, the memory will be freed early in the init process 
(c.f. init/main.c::init() -> free_initmem()). Anything that uses it later 
is touching memory that is either unallocated, or allocated by something 
else. That's a bug. 

Also, it doesn't need to be EXPORTed. If it is left as initdata, that's
another bug, because the two are semantically disjoint. However, even with
the patch below, I'm not sure why you would want to expose the variable 
(and I've in fact removed that). 
Sounds reasonable, but... what about modular ACPI? At least 
acpi_bus_register_driver() uses acpi_disabled, so it would seem to me that
every time we're loading an ACPI driver module, acpi_disabled evaluates to 
something random, as in the aforementioned case?

Additionally, if acpi_disabled is to be available for modules (i.e. modular
ACPI), it should rather be exported, shouldn't it?
Tangential question: Do preprocessor conditionals evaluate to a value? 
I.e. instead of doing: 

#ifdef	CONFIG_ACPI
	int acpi_disabled = 0;
#else
	int acpi_disabled = 1;
#endif

Could we do: 

int acpi_disabled = (CONFIG_ACPI == 'y'); 
AFAIK acpi_disabled is independent on CONFIG_ACPI, i.e. CONFIG_ACPI may be
defined, but if acpi=off is passed to the kernel command line,
acpi_disabled evaluates to 1?
Best regards and a 1:20 am CEST disclaimer: I might be talking nonsenses.

-- 
Karol 'sziwan' Kozimor
sziwan-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help