lkml.org 
[lkml]   [2000]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [idea] request_module(const char *fmt, ...);
    Date
    From
    Tigran Aivazian <tigran@sco.COM> said:

    [...]

    > so, the drivers just call request_module("block-major-%d", major);
    >
    > Disadvantage:
    >
    > 0. an extra function call even if CONFIG_KMOD is not defined. This is not
    > serious as request_module() is never called on a hot path (usually opening
    > a device etc.)

    Nope. Place:

    #ifdef CONFIG_KMOD
    int request_module(const char *fmt, ...)
    #else
    #define request_module(whatever, magic, gcc, demands, for, ...) /* Nothing */
    #endif

    into a selected .h, and a matching:

    #ifdef CONFIG_KMOD
    int request_module(const char *fmt, va_arg args)
    {
    /* ... */
    }
    #endif

    in some random .c

    > Advantages:
    >
    > 0. Code is not polluted with a multitude of #ifdef CONFIG_KMOD, thus
    > making disassembly output look more immediately recognizeable.
    >
    > 1. No dependency on CONFIG_KMOD spread around the entire kernel. So, if
    > you reconfigure the kernel changing CONFIG_KMOD, only the kernel/kmod.c is
    > recompiled.

    Not in my design... and AFAIU CONFIG_KMOD does influence quite a bit more
    than just this, so this point would be moot. I'm more wary of random
    #ifdef all over the place than to have to recompile something anyway.
    --
    Dr. Horst H. von Brand mailto:vonbrand@inf.utfsm.cl
    Departamento de Informatica Fono: +56 32 654431
    Universidad Tecnica Federico Santa Maria +56 32 654239
    Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513

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

    \
     
     \ /
      Last update: 2005-03-22 13:55    [W:4.227 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site