Johannes Berg wrote:
> On Sa, 2007-09-15 at 21:00 +0200, Eric Valette wrote:
>
>
>> I came to this conclusion too. But I would have preferred to have
>> #define subsys_exit(fn) modules_exit(fn)
>>
>> in the case of a module and nop in the non module case...
>>
>
> module_exit is a no-op anyway in the non-modular case, it's never
> called, so what's the point?
>
That I would have prefered to see subsys_exit in front of
subsys_initcall instead of module_exit because
1) it made me wonder if it still works in the module case
2) If you see the comment in init.h (/* Don't use these in modules,
but some people do... */), you should not use it in module. The comment
is, at least misleading, because for code that can be used as module or
directly embedded in some cases you are indeed forced to use it (did a
grep and found a lot)
3) Non symetrical code frequently points to errors or bad design.
YMMV :-)
4) If someone someday find something to do when shutting down
(hotrestart, fault tolerance, or something equivalent), we would have a
place to hook. C++ has destructors called after main and before __exit...
NB : This has nothing to do with the proposed patch that is definitively
correct given current init.h.
Personally, I would certainly add:
#define subsys_exit(fn) in init.h
But would rate it myself as a cosmetic change as it *only* makes the code more obvious to read :-)
-- eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]