summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorNathan Chancellor <natechancellor@gmail.com>2020-02-19 22:10:12 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-01 13:14:38 +0200
commitb92d156a32b8f40974ba38e0154b327d9605946e (patch)
tree7fda04444c3f58ee135d642581f7f0d9970885fb /kernel
parent102bdec1d1cf196aaafa4e54513490d5de6e05a4 (diff)
downloadlinux-stable-b92d156a32b8f40974ba38e0154b327d9605946e.tar.gz
linux-stable-b92d156a32b8f40974ba38e0154b327d9605946e.tar.bz2
linux-stable-b92d156a32b8f40974ba38e0154b327d9605946e.zip
tracing: Use address-of operator on section symbols
[ Upstream commit bf2cbe044da275021b2de5917240411a19e5c50d ] Clang warns: ../kernel/trace/trace.c:9335:33: warning: array comparison always evaluates to true [-Wtautological-compare] if (__stop___trace_bprintk_fmt != __start___trace_bprintk_fmt) ^ 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 runtime result of the check (tested with some print statements compiled in with clang + ld.lld and gcc + ld.bfd in QEMU). Link: http://lkml.kernel.org/r/20200220051011.26113-1-natechancellor@gmail.com Link: https://github.com/ClangBuiltLinux/linux/issues/893 Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 17505a22d800..6bf617ff0369 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -8529,7 +8529,7 @@ __init static int tracer_alloc_buffers(void)
goto out_free_buffer_mask;
/* Only allocate trace_printk buffers if a trace_printk exists */
- if (__stop___trace_bprintk_fmt != __start___trace_bprintk_fmt)
+ if (&__stop___trace_bprintk_fmt != &__start___trace_bprintk_fmt)
/* Must be called before global_trace.buffer is allocated */
trace_printk_init_buffers();