History

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

Ammar Faizi committed 4 years ago

Commit 69686fc1 parent 97a5d2e1 file · +1 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/trace/trace_events_hist.c+1−1
@@ -6217,7 +6217,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops, · 6216 unmodified lines
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 }