Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752260Ab3EUJUs (ORCPT ); Tue, 21 May 2013 05:20:48 -0400 Received: from merlin.infradead.org ([205.233.59.134]:45800 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785Ab3EUJUr (ORCPT ); Tue, 21 May 2013 05:20:47 -0400 Date: Tue, 21 May 2013 11:19:47 +0200 From: Arnaldo Carvalho de Melo To: Masami Hiramatsu Cc: Steven Rostedt , linux-kernel@vger.kernel.org, David Ahern , Srikar Dronamraju , Irina Tirdea , Frederic Weisbecker , yrl.pp-manager.tt@hitachi.com, Oleg Nesterov , Pekka Enberg , Ingo Molnar , Paul Mackerras , Tom Zanussi , Namhyung Kim , Borislav Petkov , Jiri Olsa , Peter Zijlstra Subject: Re: [PATCH 2/5] perf: Reorder parameters of strglobmatch Message-ID: <20130521091947.GD10541@ghostprotocols.net> References: <20130516114839.13508.92844.stgit@mhiramat-M0-7522> <20130516114852.13508.72995.stgit@mhiramat-M0-7522> <1368716142.6828.98.camel@gandalf.local.home> <51959417.7070403@hitachi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51959417.7070403@hitachi.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.21 (2010-09-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by merlin.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1341 Lines: 33 Em Fri, May 17, 2013 at 11:21:11AM +0900, Masami Hiramatsu escreveu: > (2013/05/16 23:55), Steven Rostedt wrote: > > I'm a bit confused to the rational here. Can you explain in more detail > > to why this patch is actually needed? > Yes, actually, this patch is not needed from the viewpoint of execution, > but less misuse for future use of the strglobmatch, I think. > For example, glob(3) has the pattern parameter as the first one, > > int glob(const char *pattern, int flags, > int (*errfunc) (const char *epath, int eerrno), > glob_t *pglob); > regexec(3) also has the compiled regexp at the first parameter, > int regexec(const regex_t *preg, const char *string, size_t nmatch, > regmatch_t pmatch[], int eflags); > Thus, I think a new user of strglobmatch() may guess that the first > parameter should be the glob pattern. > So, this patch is not technically needed, but from the viewpoint of coding > naturally, it should be changed, IMHO. So I suggest you state this in the changeset comment :-) - Arnaldo -- 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/