Skip to content

Commit 69686fc

Browse files
ammarfaizi2rostedt
authored andcommitted
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: Ammar Faizi <ammarfaizi2@gnuweeb.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 97a5d2e commit 69686fc

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
@@ -6217,7 +6217,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops,
62176217
if (WARN_ON(!glob))
62186218
return -EINVAL;
62196219

6220-
if (strlen(glob)) {
6220+
if (glob[0]) {
62216221
hist_err_clear();
62226222
last_cmd_set(file, param_and_filter);
62236223
}

0 commit comments

Comments
 (0)