From: Ammar Faizi Date: Sun, 17 Apr 2022 18:56:30 +0000 (+0700) Subject: tracing: Change `if (strlen(glob))` to `if (glob[0])` X-Git-Tag: v5.19-rc1~102^2~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69686fcbdcc0b6fed3b8d0907e641f282df2f827;p=thirdparty%2Fkernel%2Flinux.git 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 Cc: GNU/Weeb Mailing List Signed-off-by: Ammar Faizi Signed-off-by: Steven Rostedt (Google) --- diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 80c25be23c454..fe10179893c15 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -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); }