[Pkg-tpctl-devel] Bug#359812: thinkpad vs. gcc optimization

Nathanael Nerode neroden at fastmail.fm
Fri Jul 28 13:06:20 UTC 2006


Thomas Hood wrote:
>This parameter is still defined in thinkpad.c but is no longer used.  My 
guess
>is that gcc is optimizing it away.  Any ideas on how to fix this?

Well, what I see is:

static int enable_thinkpadpm = 1; /* obsolete */

My first guess is that this should *not* be "static".
Perhaps

int enable_thinkpadpm = 1;

would solve the problem.

Alternatively, if it really should be static (unlikely), try 
adding "__attribute__((unused))" to the definition which is being optimized 
away:

static int __attribute__((unused)) enable_thinkpadpm = 1; /* obsolete */

It appears from looking at the kernel headers that MODULE_PARM is deprecated 
and this entire scheme should be changed, but that's a problem for upstream.




More information about the Pkg-tpctl-devel mailing list