]> Git Repo - linux.git/commit
kernel/extable.c: use address-of operator on section symbols
authorNathan Chancellor <[email protected]>
Tue, 7 Apr 2020 03:09:27 +0000 (20:09 -0700)
committerLinus Torvalds <[email protected]>
Tue, 7 Apr 2020 17:43:42 +0000 (10:43 -0700)
commit63174f61dfaef58dc0e813eaf6602636794f8942
tree3841cec5ccba9026f523a401b16b159d4eaf8eca
parent06e85c7e9a1c1356038936566fc23f7c0d363b96
kernel/extable.c: use address-of operator on section symbols

Clang warns:

../kernel/extable.c:37:52: warning: array comparison always evaluates to
a constant [-Wtautological-compare]
        if (main_extable_sort_needed && __stop___ex_table > __start___ex_table) {
                                                          ^
1 warning generated.

These are not true arrays, they are linker defined symbols, which are just
addresses.  Using the address of operator silences the warning and does
not change the resulting assembly with either clang/ld.lld or gcc/ld
(tested with diff + objdump -Dr).

Suggested-by: Nick Desaulniers <[email protected]>
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Link: https://github.com/ClangBuiltLinux/linux/issues/892
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
kernel/extable.c
This page took 0.041608 seconds and 4 git commands to generate.