From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752808AbbEKPo3 (ORCPT ); Mon, 11 May 2015 11:44:29 -0400 Received: from mail-bn1on0078.outbound.protection.outlook.com ([157.56.110.78]:36549 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752545AbbEKPoZ (ORCPT ); Mon, 11 May 2015 11:44:25 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; perches.com; dkim=none (message not signed) header.d=none; Message-ID: <5550CE4F.2070404@xilinx.com> Date: Mon, 11 May 2015 17:44:15 +0200 From: Michal Simek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Joe Perches , Michal Simek , Julia Lawall CC: , Markus Elfring Subject: Re: [PATCH v2] net: ll_temac: Use one return statement instead of two References: <3a0fa74dd703db5dac4816ef15b6a512ef0f2ec0.1431353091.git.michal.simek@xilinx.com> <1431355371.2884.11.camel@perches.com> <5550CA19.8090404@xilinx.com> <1431358794.2884.17.camel@perches.com> In-Reply-To: <1431358794.2884.17.camel@perches.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-7.5.0.1018-21536.005 X-TM-AS-User-Approved-Sender: Yes;Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.100;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(438002)(69234005)(24454002)(189002)(377424004)(377454003)(479174004)(199003)(51704005)(164054003)(77096005)(65806001)(5001960100002)(87936001)(50986999)(76176999)(36756003)(54356999)(87266999)(189998001)(36386004)(5001770100001)(23746002)(4001350100001)(65816999)(33656002)(50466002)(63266004)(93886004)(80316001)(92566002)(106466001)(2950100001)(77156002)(62966003)(86362001)(6806004)(46102003)(83506001)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1AFFO11HUB013;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1AFFO11HUB013; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN1AFFO11HUB013;BCL:0;PCL:0;RULEID:;SRVR:BN1AFFO11HUB013; X-Forefront-PRVS: 05739BA1B5 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2015 15:44:23.1945 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1AFFO11HUB013 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/11/2015 05:39 PM, Joe Perches wrote: > 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. Does this mean that you have added me your ACK? >>> 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. yep - the only reason I have submitted this was that this is the diff in the xilinx tree compare to mainline and I don't want to simple revert it because it is correct. >> 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. Julia: Any comment? Thanks, Michal