From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754917AbbEKPmw (ORCPT ); Mon, 11 May 2015 11:42:52 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:18560 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbbEKPms (ORCPT ); Mon, 11 May 2015 11:42:48 -0400 X-IronPort-AV: E=Sophos;i="5.13,408,1427752800"; d="scan'208";a="117349802" Date: Mon, 11 May 2015 17:42:42 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Michal Simek cc: Joe Perches , linux-kernel@vger.kernel.org, Julia Lawall , Markus Elfring Subject: Re: [PATCH v2] net: ll_temac: Use one return statement instead of two In-Reply-To: <5550CA19.8090404@xilinx.com> Message-ID: References: <3a0fa74dd703db5dac4816ef15b6a512ef0f2ec0.1431353091.git.michal.simek@xilinx.com> <1431355371.2884.11.camel@perches.com> <5550CA19.8090404@xilinx.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 May 2015, Michal Simek wrote: > On 05/11/2015 04:42 PM, Joe Perches wrote: > > On Mon, 2015-05-11 at 16:05 +0200, Michal Simek wrote: > >> Use one return statement instead of two to simplify the code. > >> Both are returning the same value. > > > > trivia and FYI: > > But still correct right? > > > > > I think there are about 100 of these in kernel tree > > and I'm not going to submit patches. > > > > $ grep-2.5.4 -rP --include=*.[ch] -n "^([\t]+)\treturn[ \t]+([A-Za-z0-9\_\>\(\)\.\>\[\]\-]+);\n(\1}\n)?\1return[ \t]+\2;" * | \ > > grep -P "^[\w\/\.]+:\d+:" > > Are you suggesting that someone else should send patches for it? > I expect that this is something what Julia can check with coccinelle > and can be added to scripts folder. I can do something based on the original patch. I have no idea what the regular expression does :) julia