kernel/trace/trace_events_filter.c: use strreplace()
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 25 Jun 2015 22:02:25 +0000 (15:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Jun 2015 00:00:40 +0000 (17:00 -0700)
There's no point in starting over every time we see a ','...

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/trace/trace_events_filter.c

index 7f2e97c..9d4a78f 100644 (file)
@@ -2082,7 +2082,7 @@ struct function_filter_data {
 static char **
 ftrace_function_filter_re(char *buf, int len, int *count)
 {
-       char *str, *sep, **re;
+       char *str, **re;
 
        str = kstrndup(buf, len, GFP_KERNEL);
        if (!str)
@@ -2092,8 +2092,7 @@ ftrace_function_filter_re(char *buf, int len, int *count)
         * The argv_split function takes white space
         * as a separator, so convert ',' into spaces.
         */
-       while ((sep = strchr(str, ',')))
-               *sep = ' ';
+       strreplace(str, ',', ' ');
 
        re = argv_split(GFP_KERNEL, str, count);
        kfree(str);