• Masahiro Yamada's avatar
    modpost: remove useless export_from_sec() · 7ce3e410
    Masahiro Yamada authored
    With commit 1743694e ("modpost: stop symbol preloading for
    modversion CRC") applied, now export_from_sec() is useless.
    
    handle_symbol() is called for every symbol in the ELF.
    
    When 'symname' does not start with "__ksymtab", export_from_sec() is
    called, and the returned value is stored in 'export'.
    
    It is used in the last part of handle_symbol():
    
        if (strstarts(symname, "__ksymtab_")) {
                name = symname + strlen("__ksymtab_");
                sym_add_exported(name, mod, export);
        }
    
    'export' is used only when 'symname' starts with "__ksymtab_".
    
    So, the value returned by export_from_sec() is never used.
    
    Remove useless export_from_sec(). This makes further cleanups possible.
    
    I put the temporary code:
    
        export = export_unknown;
    
    Otherwise, I would get the compiler warning:
    
        warning: 'export' may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    This is apparently false positive because
    
        if (strstarts(symname, "__ksymtab_")
    
    ... is a stronger condition than:
    
        if (strstarts(symname, "__ksymtab")
    
    Anyway, this part will be cleaned up by the next commit.
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
    7ce3e410
modpost.c 67 KB