public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: rtl8192u: simplify conditional statement
@ 2015-10-16 13:26 Luis de Bethencourt
  2015-10-17  0:46 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Luis de Bethencourt @ 2015-10-16 13:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: dan.carpenter, devel, hamohammed.sa, paul.gortmaker, gregkh,
	gdonald, cristina.opriceana, gascoar, shraddha.6596,
	mahfouz.saif.elyazal, Luis de Bethencourt

The code can be much cleaner and readable by simplifying the conditional
statement.

Only need to check if (ieee->state > IEEE80211_LINKED) and not >= because
(ieee->state == IEEE80211_LINKED) is already checked a few lines above.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---

Sorry for the typo in the previous version and not double checking.

Shame,
Luis

 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index c443e2e..f85e5ff 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)
 			goto out;
 
 
-- 
2.5.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] staging: rtl8192u: simplify conditional statement
  2015-10-16 13:26 [PATCH v2] staging: rtl8192u: simplify conditional statement Luis de Bethencourt
@ 2015-10-17  0:46 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2015-10-17  0:46 UTC (permalink / raw)
  To: Luis de Bethencourt
  Cc: linux-kernel, devel, hamohammed.sa, paul.gortmaker, gregkh,
	gdonald, cristina.opriceana

On Fri, Oct 16, 2015 at 02:26:31PM +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..f85e5ff 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)

This should be >= instead of >.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-17  0:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 13:26 [PATCH v2] staging: rtl8192u: simplify conditional statement Luis de Bethencourt
2015-10-17  0:46 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox