• Masahiro Yamada's avatar
    modpost: remove unreachable code after fatal() · c9f2b8d4
    Masahiro Yamada authored
    Now compilers can recognize fatal() never returns.
    
    While GCC 4.5 dropped support for -Wunreachable-code, Clang is capable
    of detecting the unreachable code.
    
      $ make HOSTCC=clang HOSTCFLAGS=-Wunreachable-code-return
          [snip]
        HOSTCC  scripts/mod/modpost.o
      scripts/mod/modpost.c:520:11: warning: 'return' will never be executed [-Wunreachable-code-return]
                              return 0;
                                     ^
      scripts/mod/modpost.c:477:10: warning: 'return' will never be executed [-Wunreachable-code-return]
                      return 0;
                             ^
      2 warnings generated.
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
    c9f2b8d4
modpost.c 56.7 KB