]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Fix smatch warning for do while check in event_hist_trigger_parse()
authorTom Zanussi <zanussi@kernel.org>
Thu, 27 Jan 2022 21:44:16 +0000 (15:44 -0600)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 28 Jan 2022 00:15:48 +0000 (19:15 -0500)
commitcb00dd6612d112e293780b3198308ff19d5f2127
treeda2b340bc5adf498c6db24286e57afaa217a15d8
parent127ebbc56d51be15ee96483084d54ea5041b7ee6
tracing: Fix smatch warning for do while check in event_hist_trigger_parse()

The patch 9df13dd33cee: "tracing: Allow whitespace to surround hist
trigger filter" from Jan 15, 2018, leads to the following Smatch
static checker warning:

    kernel/trace/trace_events_hist.c:6199 event_hist_trigger_parse()
    warn: 'p' can't be NULL.

Since p is always checked for a NULL value at the top of loop and
nothing in the rest of the loop will set it to NULL, the warning
is correct and might as well be 1 to silence the warning.

Link: https://lkml.kernel.org/r/a1d4c79766c0cf61e20438dc35244d216633fef6.1643319703.git.zanussi@kernel.org
Fixes: 9df13dd33cee2 ("tracing: Allow whitespace to surround hist trigger filter")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_events_hist.c