From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754111AbbE1Qdi (ORCPT ); Thu, 28 May 2015 12:33:38 -0400 Received: from smtprelay0225.hostedemail.com ([216.40.44.225]:55910 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751556AbbE1Qdb (ORCPT ); Thu, 28 May 2015 12:33:31 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3868:3870:3871:3872:3874:4321:4605:5007:6261:10004:10400:10848:11232:11658:11914:12043:12438:12517:12519:12740:13069:13161:13229:13311:13357:13972:14096:14097: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: glove74_75c13ee263c45 X-Filterd-Recvd-Size: 2333 Message-ID: <1432830808.2846.233.camel@perches.com> Subject: Re: [PATCH] staging: gdm72xx: remove unneeded test From: Joe Perches To: Julia Lawall Cc: Laurent Navet , gregkh@linuxfoundation.org, benchan@chromium.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Thu, 28 May 2015 09:33:28 -0700 In-Reply-To: References: <1432758345-8095-1-git-send-email-laurent.navet@gmail.com> <1432758608.2846.169.camel@perches.com> <1432792110.2846.199.camel@perches.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 Thu, 2015-05-28 at 18:21 +0200, Julia Lawall wrote: > > On Wed, 27 May 2015, Joe Perches wrote: > > > On Thu, 2015-05-28 at 07:43 +0200, Julia Lawall wrote: > > > On Wed, 27 May 2015, Joe Perches wrote: > > > > Perhaps all of the uses like: > > > > > > > > goto ; > > > > : > > > > > > > > could be modified. There are ~150 in the kernel. > > > > > > I wrote a semantic patch recently for that as well... Maybe I can take > > > care of it. > > > > Great. Thanks Julia. > > > > There may be some reorganization of code that is > > possible for many of these than coccinelle may > > not perform well though. > > As what looks like an extreme example, wouldn't this function be better as > just return inet6_register_protosw(&rawv6_protosw); ? > > int __init rawv6_init(void) > { > int ret; > > ret = inet6_register_protosw(&rawv6_protosw); > if (ret) > goto out; > out: > return ret; > } That style is exactly what I was thinking about. Yes, I think this would indeed be much better as a single line and might have been better still removed altogether but for the rawv6_protosw hiding. There are a couple others just like it in net/