kernel/extable.c: use address-of operator on section symbols 60/292560/1
authorNathan Chancellor <natechancellor@gmail.com>
Tue, 7 Apr 2020 03:09:27 +0000 (20:09 -0700)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 8 May 2023 09:34:34 +0000 (18:34 +0900)
commited0d0e04a0e2bd2ac3531fad05eaa4f91995c1ef
tree9a7a0846cfeb4f7144e5b086b8f590a89cabaeaf
parentfa2c1f7935131363cfb14d3c009327128a17a53f
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 <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://github.com/ClangBuiltLinux/linux/issues/892
Link: http://lkml.kernel.org/r/20200219202036.45702-1-natechancellor@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[sw0312.kim: cherry-pick upstream commit 63174f61dfae to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Iead005392ebb5b2b334a7eae324883cc5f75c2cc
kernel/extable.c