From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752816AbbJLWHq (ORCPT ); Mon, 12 Oct 2015 18:07:46 -0400 Received: from smtprelay0192.hostedemail.com ([216.40.44.192]:40777 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751558AbbJLWHB (ORCPT ); Mon, 12 Oct 2015 18:07:01 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::,RULES_HIT:41:355:379:541:599: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:2559:2562:2692:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3872:4321:5007:6261:6742:7875:9040:10004:10400:10848:11026:11232:11658:11914:12043:12438:12517:12519: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: drop56_59faabbc00455 X-Filterd-Recvd-Size: 2237 Message-ID: <1444687617.9184.4.camel@perches.com> Subject: Re: [PATCH 3/9] usb/host/fotg210: Remove useless else statement From: Joe Perches To: Peter Senna Tschudin Cc: gregkh@linuxfoundation.org, sergei.shtylyov@cogentembedded.com, jkosina@suse.cz, rdunlap@infradead.org, balbi@ti.com, standby24x7@gmail.com, chris@rorvick.com, stern@rowland.harvard.edu, john453@faraday-tech.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 12 Oct 2015 15:06:57 -0700 In-Reply-To: <1444684960-8088-4-git-send-email-peter.senna@gmail.com> References: <1442847678-7970-1-git-send-email-peter.senna@gmail.com> <1444684960-8088-1-git-send-email-peter.senna@gmail.com> <1444684960-8088-4-git-send-email-peter.senna@gmail.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-10-12 at 23:22 +0200, Peter Senna Tschudin wrote: > This patch remove an else statement after a return to make the code > easier to understand. [] > diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c [] > @@ -1402,10 +1402,9 @@ static int check_reset_complete(struct fotg210_hcd *fotg210, int index, > "Failed to enable port %d on root hub TT\n", > index + 1); > return port_status; > - } else { > - fotg210_dbg(fotg210, "port %d reset complete, port enabled\n", > - index + 1); > } > + fotg210_dbg(fotg210, "port %d reset complete, port enabled\n", > + index + 1); > > return port_status; > } Probably better written as: /* if reset finished and it's still not enabled -- handoff */ if (!(port_status & PORT_PE)) /* with integrated TT, there's nobody to hand it to! */ fotg210_dbg(fotg210, "failed to enable port %d on root hub TT\n", index + 1); else fotg210_dbg(fotg210, "port %d reset complete, port enabled\n", index + 1); return port_status;