Skip to content

Commit

Permalink
tracing: Change if (strlen(glob)) to if (glob[0])
Browse files Browse the repository at this point in the history
No need to traverse to the end of string. If the first byte is not a NUL
char, it's guaranteed `if (strlen(glob))` is true.

Link: https://lkml.kernel.org/r/20220417185630.199062-3-ammarfaizi2@gnuweeb.org

Cc: Ingo Molnar <mingo@redhat.com>
Cc: GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
  • Loading branch information
ammarfaizi2 authored and rostedt committed Apr 26, 2022
1 parent 97a5d2e commit 69686fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_events_hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -6217,7 +6217,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
if (WARN_ON(!glob))
return -EINVAL;

if (strlen(glob)) {
if (glob[0]) {
hist_err_clear();
last_cmd_set(file, param_and_filter);
}
Expand Down

0 comments on commit 69686fc

Please sign in to comment.