From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752284AbcELBrE (ORCPT ); Wed, 11 May 2016 21:47:04 -0400 Received: from mail.kernel.org ([198.145.29.136]:33509 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751751AbcELBrB (ORCPT ); Wed, 11 May 2016 21:47:01 -0400 Date: Thu, 12 May 2016 10:46:52 +0900 From: Masami Hiramatsu To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, Namhyung Kim , Peter Zijlstra , Ingo Molnar , Hemant Kumar , Ananth N Mavinakayanahalli , Brendan Gregg Subject: Re: [PATCH perf/core v7 01/21] tools/perf: Fix lsdir to set errno correctly Message-Id: <20160512104652.a4c4bd1fa8814a3e84f190ee@kernel.org> In-Reply-To: <20160511135939.GC3619@kernel.org> References: <20160511135110.23943.38738.stgit@devbox> <20160511135127.23943.40644.stgit@devbox> <20160511135939.GC3619@kernel.org> X-Mailer: Sylpheed 3.4.3 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnaldo, On Wed, 11 May 2016 10:59:39 -0300 Arnaldo Carvalho de Melo wrote: > Em Wed, May 11, 2016 at 10:51:27PM +0900, Masami Hiramatsu escreveu: > > Fix lsdir() to set correct positive error number (ENOMEM). > > Since "errno" must have a positive error number instead of > > negative number, fix lsdir to set it correctly. > > Masami, please try to: > > 1) Follow existing convention when writing the patch Subject line, when > in doubt: git log tools/perf/util/util.c and check, in this case I > changed it to "perf tools: Fix lsdir to set errno correctly" OK, I see. > 2) Add a Fixed line, for this case I used 'git blame' and added: > > Fixes: e1ce726e1db2 ("perf tools: Add lsdir() helper to read a directory") > > This helps reviewing (now and down the line), because one can go more > quickly check what was the intention in the original patch, to see if it > is really a fix. Oops! I just missed that. Of course I will do. > > In some cases this looks trivial, like in this patch, sometimes its > not... I see. Thank you, > > Thanks, > > - Arnaldo > > > Signed-off-by: Masami Hiramatsu > > --- > > tools/perf/util/util.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c > > index 01c9433..eab077a 100644 > > --- a/tools/perf/util/util.c > > +++ b/tools/perf/util/util.c > > @@ -139,7 +139,7 @@ struct strlist *lsdir(const char *name, > > > > list = strlist__new(NULL, NULL); > > if (!list) { > > - errno = -ENOMEM; > > + errno = ENOMEM; > > goto out; > > } > > -- Masami Hiramatsu