Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751832AbaLRWiY (ORCPT ); Thu, 18 Dec 2014 17:38:24 -0500 Received: from mail-pd0-f178.google.com ([209.85.192.178]:38231 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751125AbaLRWiX (ORCPT ); Thu, 18 Dec 2014 17:38:23 -0500 Date: Thu, 18 Dec 2014 14:38:19 -0800 From: Jeremiah Mahler To: Karthik Nayak Cc: trivial@kernel.org, gregkh@linuxfoundation.org, anarey@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Staging: rtl8192u: removed an unnecessary else statement Message-ID: <20141218223819.GB6742@hudson.localdomain> Mail-Followup-To: Jeremiah Mahler , Karthik Nayak , trivial@kernel.org, gregkh@linuxfoundation.org, anarey@gmail.com, linux-kernel@vger.kernel.org References: <1418894411-9787-1-git-send-email-karthik.188@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1418894411-9787-1-git-send-email-karthik.188@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Karthik, On Thu, Dec 18, 2014 at 02:50:11PM +0530, Karthik Nayak wrote: > As per checkpatch warning, removed an unnecessary else statement > proceeding an if statement with a return. > > Signed-off-by: Karthik Nayak > --- > drivers/staging/rtl8192u/r8192U_dm.c | 16 +++++++--------- > 1 file changed, 7 insertions(+), 9 deletions(-) > > diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c > index 936565d..b3b508c 100644 > --- a/drivers/staging/rtl8192u/r8192U_dm.c > +++ b/drivers/staging/rtl8192u/r8192U_dm.c > @@ -480,15 +480,13 @@ static void dm_bandwidth_autoswitch(struct net_device *dev) > > if(priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 ||!priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable){ > return; > - }else{ > - if(priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false){//If send packets in 40 Mhz in 20/40 > - if(priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) > - priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; > - }else{//in force send packets in 20 Mhz in 20/40 > - if(priv->undecorated_smoothed_pwdb >= priv->ieee80211->bandwidth_auto_switch.threshold_20Mhzto40Mhz) > - priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = false; > - > - } > + } > + if(priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false){//If send packets in 40 Mhz in 20/40 > + if(priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) > + priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; > + }else{//in force send packets in 20 Mhz in 20/40 > + if(priv->undecorated_smoothed_pwdb >= priv->ieee80211->bandwidth_auto_switch.threshold_20Mhzto40Mhz) > + priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = false; > } > } // dm_BandwidthAutoSwitch > [...] Wow, I don't think I have ever seen a file with so many checkpatch errors! Instead of only fixing one instance of one error I would fix all instances of that type of error. Since the changes would be very similar it should still be easy to review. You could even make a whole patch series with each patch fixing one type of error. Although I would keep the series to just a few at first until you are sure you are doing everything right. -- - Jeremiah Mahler -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/