Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752534AbZIYINv (ORCPT ); Fri, 25 Sep 2009 04:13:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751241AbZIYINr (ORCPT ); Fri, 25 Sep 2009 04:13:47 -0400 Received: from centrinvest.ru ([94.25.115.130]:53612 "EHLO centrinvest.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751886AbZIYINq (ORCPT ); Fri, 25 Sep 2009 04:13:46 -0400 From: "Andrey Panin" Date: Fri, 25 Sep 2009 12:13:45 +0400 To: Frederic Weisbecker Cc: Ingo Molnar , LKML , Steven Rostedt , Tom Zanussi , Li Zefan Subject: Re: [PATCH 4/5 v2] tracing/filters: Provide basic regex support Message-ID: <20090925081345.GA9236@centrinvest.ru> Mail-Followup-To: Frederic Weisbecker , Ingo Molnar , LKML , Steven Rostedt , Tom Zanussi , Li Zefan References: <1253821775-8618-1-git-send-email-fweisbec@gmail.com> <1253821775-8618-5-git-send-email-fweisbec@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1253821775-8618-5-git-send-email-fweisbec@gmail.com> X-Uname: Linux 2.6.26-1-amd64 x86_64 User-Agent: Mutt/1.5.20 (2009-06-14) X-Anti-Virus: kav4lms: continue Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 865 Lines: 25 On 267, 09 24, 2009 at 09:49:34PM +0200, Frederic Weisbecker wrote: > This patch provides basic support for regular expressions in filters. > +/* Basic regex callbacks */ > +static int regex_match_full(char *str, struct regex *r, int len) > +{ > + if (strncmp(str, r->pattern, len) == 0) > + return 1; > + return 0; > +} > + > +static int regex_match_front(char *str, struct regex *r, int len) > +{ > + if (strncmp(str, r->pattern, len) == 0) > + return 1; > + return 0; > +} These two functions are identical, what's the reason to keep them separate ? And why not simply return strncmp(str, r->pattern, len) == 0 ? -- 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/