Commit 69686fcb authored by Ammar Faizi's avatar Ammar Faizi Committed by Steven Rostedt (Google)

tracing: Change `if (strlen(glob))` to `if (glob[0])`

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: default avatarAmmar Faizi <ammarfaizi2@gnuweeb.org>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent 97a5d2e5
...@@ -6217,7 +6217,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops, ...@@ -6217,7 +6217,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
if (WARN_ON(!glob)) if (WARN_ON(!glob))
return -EINVAL; return -EINVAL;
if (strlen(glob)) { if (glob[0]) {
hist_err_clear(); hist_err_clear();
last_cmd_set(file, param_and_filter); last_cmd_set(file, param_and_filter);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment