Skip to content

Commit 400ddf1

Browse files
committed
tracing: Use strim() in trigger_process_regex() instead of skip_spaces()
The function trigger_process_regex() is called by a few functions, where only one calls strim() on the buffer passed to it. That leaves the other functions not trimming the end of the buffer passed in and making it a little inconsistent. Remove the strim() from event_trigger_regex_write() and have trigger_process_regex() use strim() instead of skip_spaces(). The buff variable is not passed in as const, so it can be modified. Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Tom Zanussi <zanussi@kernel.org> Link: https://patch.msgid.link/20251125214032.323747707@kernel.org Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 61d445a commit 400ddf1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

kernel/trace/trace_events_trigger.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ int trigger_process_regex(struct trace_event_file *file, char *buff)
308308
char *command, *next;
309309
struct event_command *p;
310310

311-
next = buff = skip_spaces(buff);
311+
next = buff = strim(buff);
312+
312313
command = strsep(&next, ": \t");
313314
if (next) {
314315
next = skip_spaces(next);
@@ -345,8 +346,6 @@ static ssize_t event_trigger_regex_write(struct file *file,
345346
if (IS_ERR(buf))
346347
return PTR_ERR(buf);
347348

348-
strim(buf);
349-
350349
guard(mutex)(&event_mutex);
351350

352351
event_file = event_file_file(file);

0 commit comments

Comments
 (0)