Commit 1bb56471 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Linus Torvalds

kernel/trace/trace_events_filter.c: use strreplace()

There's no point in starting over every time we see a ','...
Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 94df2904
...@@ -2082,7 +2082,7 @@ struct function_filter_data { ...@@ -2082,7 +2082,7 @@ struct function_filter_data {
static char ** static char **
ftrace_function_filter_re(char *buf, int len, int *count) ftrace_function_filter_re(char *buf, int len, int *count)
{ {
char *str, *sep, **re; char *str, **re;
str = kstrndup(buf, len, GFP_KERNEL); str = kstrndup(buf, len, GFP_KERNEL);
if (!str) if (!str)
...@@ -2092,8 +2092,7 @@ ftrace_function_filter_re(char *buf, int len, int *count) ...@@ -2092,8 +2092,7 @@ ftrace_function_filter_re(char *buf, int len, int *count)
* The argv_split function takes white space * The argv_split function takes white space
* as a separator, so convert ',' into spaces. * as a separator, so convert ',' into spaces.
*/ */
while ((sep = strchr(str, ','))) strreplace(str, ',', ' ');
*sep = ' ';
re = argv_split(GFP_KERNEL, str, count); re = argv_split(GFP_KERNEL, str, count);
kfree(str); kfree(str);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment