lkml.org 
[lkml]   [2005]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH][RFC] disable built-in modules V2
    On Apr 7, 2005 4:38 AM, Horst von Brand <vonbrand@inf.utfsm.cl> wrote:
    > AsterixTheGaul <asterixthegaul@gmail.com> 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 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/

    \
     
     \ /
      Last update: 2005-04-07 23:37    [W:2.505 / U:0.252 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site