]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Avoid -Warray-bounds warning for __rel_loc macro
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 25 Jan 2022 14:19:30 +0000 (23:19 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:26 +0000 (14:24 +0200)
commitc2a94459dd4d4cc8774fd7baf3c37c71862986f3
treeb03f122b328624dc6e28e7d459128a009e96ebfa
parentac7887cf243babbfca2ac6e28c0ba5147523ce3c
tracing: Avoid -Warray-bounds warning for __rel_loc macro

[ Upstream commit f40a3d11f3b0a55f0f33d0d7d325a08f6db91564 ]

Since -Warray-bounds checks the destination size from the type of given
pointer, __assign_rel_str() macro gets warned because it passes the
pointer to the 'u32' field instead of 'trace_event_raw_*' data structure.
Pass the data address calculated from the 'trace_event_raw_*' instead of
'u32' __rel_loc field.

Link: https://lkml.kernel.org/r/20220125233154.dac280ed36944c0c2fe6f3ac@kernel.org
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
[ This did not fix the warning, but is still a nice clean up ]
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/trace/trace_events.h