Skip to content

Commit b59f2f2

Browse files
Tom Zanussirostedt
authored andcommitted
tracing: Fix smatch warning for do while check in event_hist_trigger_parse()
The patch ec5ce09: "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: ec5ce09 ("tracing: Allow whitespace to surround hist trigger filter") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Tom Zanussi <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 798a5b6 commit b59f2f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace_events_hist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6199,7 +6199,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
61996199
continue;
62006200
}
62016201
break;
6202-
} while (p);
6202+
} while (1);
62036203

62046204
if (!p)
62056205
param = NULL;

0 commit comments

Comments
 (0)