Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932638AbbFHX1V (ORCPT ); Mon, 8 Jun 2015 19:27:21 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:35363 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932509AbbFHX1S (ORCPT ); Mon, 8 Jun 2015 19:27:18 -0400 From: Rasmus Villemoes To: Andrew Morton , Steven Rostedt , Ingo Molnar Cc: Joe Perches , Al Viro , Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/8] kernel/trace/trace_events_filter.c: Use strreplace Date: Tue, 9 Jun 2015 01:26:50 +0200 Message-Id: <1433806017-10823-3-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1433806017-10823-1-git-send-email-linux@rasmusvillemoes.dk> References: <1433806017-10823-1-git-send-email-linux@rasmusvillemoes.dk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1307 Lines: 41 There's no point in starting over every time we see a ','... Signed-off-by: Rasmus Villemoes Acked-by: Steven Rostedt --- v2: same patch, added Ack. kernel/trace/trace_events_filter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index ced69da0ff55..a987601d7b43 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c @@ -2075,7 +2075,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) @@ -2085,8 +2085,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); -- 2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/