On Apr 7, 2005 4:38 AM, Horst von Brand <[email protected]> wrote:
> AsterixTheGaul <[email protected]> said:
> > > -#define module_init(x) __initcall(x);
> > > +#define module_init(x) __initcall(x); __module_init_disable(x);
> >
> > It would be better if there is brackets around them... like
> >
> > #define module_init(x) { __initcall(x); __module_init_disable(x); }
> >
> > then we know it wont break some code like
> >
> > if (..)
> > module_init(x);
>
> But happily break:
>
> if (...)
> module_init(x);
> else
> ...
>
> This should be:
>
> #define module_init(x) do {__initcall(x); __module_init_disable(x);}while(0)
Yes and no. =) Wrapping defines in do {} while(0) is nice when you are
using the defined constants inside functions. module_init() OTOH is
never used inside a function and your suggestion leads to compile
errors:
CC arch/i386/kernel/dmi_scan.o
CC arch/i386/kernel/bootflag.o
arch/i386/kernel/bootflag.c:99: error: parse error before "do"
arch/i386/kernel/bootflag.c:99: error: parse error before '}' token
make[1]: *** [arch/i386/kernel/bootflag.o] Error 1
make: *** [arch/i386/kernel] Error 2
damm@clementine linux-2.6.12-rc2-disable_builtin $
/ magnus
-
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]