diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2020-04-06 20:09:27 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-06-09 10:22:53 +0200 |
commit | 1a218c4cda552faeda3c55fcee2dd85569cc8b9c (patch) | |
tree | 5a3ea6486ae3fa7aae571c142cbbd2c17bdfb073 | |
parent | b1bea83acc3dd22f7d4d9c324f8d6c2617bea8be (diff) | |
download | linux-stable-1a218c4cda552faeda3c55fcee2dd85569cc8b9c.tar.gz linux-stable-1a218c4cda552faeda3c55fcee2dd85569cc8b9c.tar.bz2 linux-stable-1a218c4cda552faeda3c55fcee2dd85569cc8b9c.zip |
kernel/extable.c: use address-of operator on section symbols
commit 63174f61dfaef58dc0e813eaf6602636794f8942 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | kernel/extable.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/extable.c b/kernel/extable.c index 9aa1cc41ecf7..59650ce26b2e 100644 --- a/kernel/extable.c +++ b/kernel/extable.c @@ -44,7 +44,8 @@ u32 __initdata __visible main_extable_sort_needed = 1; /* Sort the kernel's built-in exception table */ void __init sort_main_extable(void) { - if (main_extable_sort_needed && __stop___ex_table > __start___ex_table) { + if (main_extable_sort_needed && + &__stop___ex_table > &__start___ex_table) { pr_notice("Sorting __ex_table...\n"); sort_extable(__start___ex_table, __stop___ex_table); } |