mirror of
https://github.com/torvalds/linux.git
synced 2026-11-23 23:11:40 +00:00
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 <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Tom Zanussi <[email protected]> Link: https://patch.msgid.link/[email protected] Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
This commit is contained in:
committed by
Steven Rostedt (Google)
parent
61d445af0a
commit
400ddf1dbe
@@ -308,7 +308,8 @@ int trigger_process_regex(struct trace_event_file *file, char *buff)
|
||||
char *command, *next;
|
||||
struct event_command *p;
|
||||
|
||||
next = buff = skip_spaces(buff);
|
||||
next = buff = strim(buff);
|
||||
|
||||
command = strsep(&next, ": \t");
|
||||
if (next) {
|
||||
next = skip_spaces(next);
|
||||
@@ -345,8 +346,6 @@ static ssize_t event_trigger_regex_write(struct file *file,
|
||||
if (IS_ERR(buf))
|
||||
return PTR_ERR(buf);
|
||||
|
||||
strim(buf);
|
||||
|
||||
guard(mutex)(&event_mutex);
|
||||
|
||||
event_file = event_file_file(file);
|
||||
|
||||
Reference in New Issue
Block a user