Re: [patch] 2.4.16 for pointers to __devexit functions

Keith Owens
2001-12-06T09:55:15Z

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.