aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_events_hist.c
diff options
context:
space:
mode:
authorAmmar Faizi <ammarfaizi2@gnuweeb.org>2022-04-18 01:56:30 +0700
committerSteven Rostedt (Google) <rostedt@goodmis.org>2022-04-26 17:58:52 -0400
commit69686fcbdcc0b6fed3b8d0907e641f282df2f827 (patch)
tree970068a1d785db46a00092af0da75886af09c0ae /kernel/trace/trace_events_hist.c
parenttracing: Return -EINVAL if WARN_ON(!glob) triggered in event_hist_trigger_parse() (diff)
downloadlinux-dev-69686fcbdcc0b6fed3b8d0907e641f282df2f827.tar.xz
linux-dev-69686fcbdcc0b6fed3b8d0907e641f282df2f827.zip
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>
Diffstat (limited to 'kernel/trace/trace_events_hist.c')
-rw-r--r--kernel/trace/trace_events_hist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 80c25be23c45..fe10179893c1 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);
}