[lkml]   [2003]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH] 2.5.54 kill module.h compiler warnings

    Compiling kernel 2.5.54 with CONFIG_MODULES=n results in
    tons and tons of the following warnings:

    include/linux/module.h:317: warning: statement with no effect
    include/linux/module.h:353: warning: statement with no effect

    patch-2.5.54 changed *MOD_INC_USE_COUNT from macros to
    __deprecated functions, but also dropped the (void) casts
    in front of the try_module_get() calls. Without modules,
    try_module_get() is the constant 1, hence the warnings.

    The patch below silences the warnings by adding back the
    missing (void) casts. Works for me.


    --- linux-2.5.54/include/linux/module.h.~1~ 2003-01-02 14:27:56.000000000 +0100
    +++ linux-2.5.54/include/linux/module.h 2003-01-02 16:39:49.000000000 +0100
    @@ -314,7 +314,7 @@
    * Yes, we ignore the retval here, that's why it's deprecated.
    - try_module_get(module);
    + (void)try_module_get(module);

    static inline void __deprecated __MOD_DEC_USE_COUNT(struct module *module)
    @@ -350,7 +350,7 @@
    - try_module_get(module);
    + (void)try_module_get(module);
    #define MOD_INC_USE_COUNT \
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at
     \ /
      Last update: 2005-03-22 13:32    [W:0.018 / U:1.084 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site