• Masahiro Yamada's avatar
    modpost: remove annoying namespace_from_kstrtabns() · 79f646e8
    Masahiro Yamada authored
    There are two call sites for sym_update_namespace().
    
    When the symbol has no namespace, s->namespace is set to NULL,
    but the conversion from "" to NULL is done in two different places.
    
    [1] read_symbols()
    
      This gets the namespace from __kstrtabns_<symbol>. If the symbol has
      no namespace, sym_get_data(info, sym) returns the empty string "".
      namespace_from_kstrtabns() converts it to NULL before it is passed to
      sym_update_namespace().
    
    [2] read_dump()
    
      This gets the namespace from the dump file, *.symvers. If the symbol
      has no namespace, the 'namespace' is the empty string "", which is
      directly passed into sym_update_namespace(). The conversion from
      "" to NULL is done in sym_update_namespace().
    
    namespace_from_kstrtabns() exists only for creating this inconsistency.
    
    Remove namespace_from_kstrtabns() so that sym_update_namespace() is
    consistently passed with "" instead of NULL.
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
    79f646e8
modpost.c 66.7 KB