]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lib/dynamic_debug.c: use address-of operator on section symbols
authorNathan Chancellor <natechancellor@gmail.com>
Tue, 7 Apr 2020 03:10:45 +0000 (20:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:29:02 +0000 (10:29 +0200)
commit843f517667845595694aec4d52fd4f6bd4c1a20f
tree73834a11c047609e5c420db2e28ed76b2013eaca
parent0638dcc7e75fbb766761e7b4694d0f0f141bbbd1
lib/dynamic_debug.c: use address-of operator on section symbols

commit 8306b057a85ec07482da5d4b99d5c0b47af69be1 upstream.

Clang warns:

../lib/dynamic_debug.c:1034:24: warning: array comparison always
evaluates to false [-Wtautological-compare]
        if (__start___verbose == __stop___verbose) {
                              ^
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>
Acked-by: Jason Baron <jbaron@akamai.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/894
Link: http://lkml.kernel.org/r/20200220051320.10739-1-natechancellor@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/dynamic_debug.c