[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151015125611.GZ7340@mwanda>
Date: Thu, 15 Oct 2015 15:56:12 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Luis de Bethencourt <luisbg@....samsung.com>
Cc: linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
hamohammed.sa@...il.com, paul.gortmaker@...driver.com,
gregkh@...uxfoundation.org, gdonald@...il.com,
cristina.opriceana@...il.com
Subject: Re: [PATCH] staging: rtl8192u: simplify conditional statement
On Thu, Oct 15, 2015 at 01:33:14PM +0100, Luis de Bethencourt wrote:
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> index c443e2e..1c2d1a4 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> @@ -466,10 +466,7 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
> /* this prevent excessive time wait when we
> * need to wait for a syncro scan to end..
> */
> - if(ieee->state < IEEE80211_LINKED)
> - ;
> - else
> - if (ieee->sync_scan_hurryup)
> + if(!ieee->state > IEEE80211_LINKED && ieee->sync_scan_hurryup)
The precedence is wrong here. What you wrote is equivalent to:
if ((!ieee->state) > IEEE80211_LINKED)
goto out;
Which can never be true. Also use checkpatch.pl on your patches before
sending.
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists