Re: [patch] 2.4.16 for pointers to __devexit functions

Keith Owens (kaos@ocs.com.au)
Thu, 06 Dec 2001 20:54:37 +1100


On Thu, 06 Dec 2001 03:09:46 -0500,
Jeff Garzik <jgarzik@mandrakesoft.com> wrote:
>> This patch against 2.4.16 defines __devexit_p() for pointers to
>> functions defined as __devexit, the wrapper inserts the function name
>> or NULL, based on config options. It allows people to use the new
>> binutils on the kernel, there are some real kernel bugs that binutils
>> will find once this patch is in.
>>
>> I have patched all the obvious references to __devexit functions,
>> leaving a few which appear to be real bugs. I notified the maintainers
>> of the buggy code privately.
>
>Why not __attribute__((weak)) ?

Because there are some real bugs in the kernel where code incorrectly
calls routines marked __devexit, a global conversion of __devexit
functions to NULL or weak will hide the bugs as well as the good code.
Most of the bugs are on error paths, typically an init routine calling
the exit code on error. Changing to BUG() does not help either, that
only shows up the buggy code in the unlikely event of a device error.

Using __devexit_p() will automatically remove the references that
should not exist, the new binutils can then catch the other buggy code
at link time.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/