Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1248757 > unrolled thread

[PATCH v2] staging: rtl8192u: simplify conditional statement

Started byLuis de Bethencourt <luisbg@osg.samsung.com>
First post2015-10-16 15:30 +0200
Last post2015-10-17 02:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] staging: rtl8192u: simplify conditional statement Luis de Bethencourt <luisbg@osg.samsung.com> - 2015-10-16 15:30 +0200
    Re: [PATCH v2] staging: rtl8192u: simplify conditional statement Dan Carpenter <dan.carpenter@oracle.com> - 2015-10-17 02:50 +0200

#1248757 — [PATCH v2] staging: rtl8192u: simplify conditional statement

FromLuis de Bethencourt <luisbg@osg.samsung.com>
Date2015-10-16 15:30 +0200
Subject[PATCH v2] staging: rtl8192u: simplify conditional statement
Message-ID<qkdf5-7zE-27@gated-at.bofh.it>
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

--
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/

[toc] | [next] | [standalone]


#1249230

FromDan Carpenter <dan.carpenter@oracle.com>
Date2015-10-17 02:50 +0200
Message-ID<qknR7-6bK-5@gated-at.bofh.it>
In reply to#1248757
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

--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web