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
Unified · Split
| @@ -6217,7 +6217,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops, · 6216 unmodified lines | ||
| 6217 | 6217 | if (WARN_ON(!glob)) |
| 6218 | 6218 | return -EINVAL; |
| 6219 | 6219 | |
| 6220 | − if (strlen(glob)) { | |
| 6220 | + if (glob[0]) { | |
| 6221 | 6221 | hist_err_clear(); |
| 6222 | 6222 | last_cmd_set(file, param_and_filter); |
| 6223 | 6223 | } |