Skip to content

Commit

Permalink
kernel/trace/trace_events_filter.c: use strreplace()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rasmus Villemoes authored and Linus Torvalds committed Jun 26, 2015
1 parent 94df290 commit 1bb5647
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 1bb5647

Please sign in to comment.