Commit c9f2b8d
committed
modpost: remove unreachable code after fatal()
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: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>1 parent 5cac96f commit c9f2b8d
1 file changed
Lines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
483 | | - | |
484 | 482 | | |
485 | 483 | | |
486 | 484 | | |
| |||
518 | 516 | | |
519 | 517 | | |
520 | 518 | | |
521 | | - | |
| 519 | + | |
522 | 520 | | |
523 | 521 | | |
524 | 522 | | |
525 | | - | |
526 | | - | |
| 523 | + | |
527 | 524 | | |
528 | 525 | | |
529 | 526 | | |
| |||
0 commit comments