[RESEND PATCH 2/2] tracing: Change `if (strlen(glob))` to `if (glob[0])`
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: [RESEND PATCH 2/2] tracing: Change `if (strlen(glob))` to `if (glob[0])`
- From: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>
- Date: Mon, 18 Apr 2022 01:56:30 +0700
- Cc: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>, GNU/Weeb Mailing List <gwml@xxxxxxxxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Linux Trace Devel Mailing List <linux-trace-devel@xxxxxxxxxxxxxxx>
- In-reply-to: <20220417185630.199062-1-ammarfaizi2@gnuweeb.org>
- References: <20220417185630.199062-1-ammarfaizi2@gnuweeb.org>
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.
Signed-off-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>
---
kernel/trace/trace_events_hist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 0b99ad68e3fa..1968e497ef44 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -6189,7 +6189,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);
}
--
Ammar Faizi
[Index of Archives]
[Linux USB Development]
[Linux USB Development]
[Linux Audio Users]
[Yosemite Hiking]
[Linux Kernel]
[Linux SCSI]