From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754414AbbEKPkA (ORCPT ); Mon, 11 May 2015 11:40:00 -0400 Received: from smtprelay0072.hostedemail.com ([216.40.44.72]:55517 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753229AbbEKPj5 (ORCPT ); Mon, 11 May 2015 11:39:57 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2689:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:6261:10004:10400:10848:11232:11658:11914:12043:12517:12519:12663:12740:13069:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: slave39_73c7d1bb64533 X-Filterd-Recvd-Size: 2058 Message-ID: <1431358794.2884.17.camel@perches.com> Subject: Re: [PATCH v2] net: ll_temac: Use one return statement instead of two From: Joe Perches To: Michal Simek Cc: linux-kernel@vger.kernel.org, Julia Lawall , Markus Elfring Date: Mon, 11 May 2015 08:39:54 -0700 In-Reply-To: <5550CA19.8090404@xilinx.com> References: <3a0fa74dd703db5dac4816ef15b6a512ef0f2ec0.1431353091.git.michal.simek@xilinx.com> <1431355371.2884.11.camel@perches.com> <5550CA19.8090404@xilinx.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2015-05-11 at 17:26 +0200, 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? Yes. > > 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 get enough grief for doing style oriented patches, so if someone else wants to, sure. > I expect that this is something what Julia can check with coccinelle > and can be added to scripts folder. Maybe true. A coccinelle script might be rather more complicated than the simpler grep above, but perhaps the script could be a bit more complete as it could likely look at more code indentation styles.