mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging:rtl8188eu:core Remove unneccessary else block
@ 2017-08-31 11:33 Janani Sankara Babu
  2017-08-31 12:09 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Janani Sankara Babu @ 2017-08-31 11:33 UTC (permalink / raw)
  To: gregkh; +Cc: insafonov, gs051095, devel, linux-kernel, Janani Sankara Babu

This patch is created to remove the unneccessary else statement inside the
function 'SecIsInPMKIDList'.

Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index d3668ca..8480d30 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -1708,13 +1708,10 @@ static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid)
 
 	do {
 		if ((psecuritypriv->PMKIDList[i].bUsed) &&
-		    (!memcmp(psecuritypriv->PMKIDList[i].Bssid, bssid, ETH_ALEN))) {
+		    (!memcmp(psecuritypriv->PMKIDList[i].Bssid, bssid, ETH_ALEN)))
 			break;
-		} else {
-			i++;
-			/* continue; */
-		}
-
+		i++;
+		/* continue; */
 	} while (i < NUM_PMKID_CACHE);
 
 	if (i == NUM_PMKID_CACHE)
-- 
1.9.1

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

* Re: [PATCH] staging:rtl8188eu:core Remove unneccessary else block
  2017-08-31 11:33 [PATCH] staging:rtl8188eu:core Remove unneccessary else block Janani Sankara Babu
@ 2017-08-31 12:09 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2017-08-31 12:09 UTC (permalink / raw)
  To: Janani Sankara Babu; +Cc: gregkh, devel, linux-kernel, insafonov, gs051095

On Thu, Aug 31, 2017 at 05:03:30PM +0530, Janani Sankara Babu wrote:
> This patch is created to remove the unneccessary else statement inside the
> function 'SecIsInPMKIDList'.
> 
> Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>
> ---
>  drivers/staging/rtl8188eu/core/rtw_mlme.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
> index d3668ca..8480d30 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
> @@ -1708,13 +1708,10 @@ static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid)
>  
>  	do {
>  		if ((psecuritypriv->PMKIDList[i].bUsed) &&
> -		    (!memcmp(psecuritypriv->PMKIDList[i].Bssid, bssid, ETH_ALEN))) {
> +		    (!memcmp(psecuritypriv->PMKIDList[i].Bssid, bssid, ETH_ALEN)))
>  			break;
> -		} else {
> -			i++;
> -			/* continue; */
> -		}
> -
> +		i++;
> +		/* continue; */

Delete the continue comment as well.  It doesn't add anything.

>  	} while (i < NUM_PMKID_CACHE);

Or you could move the increment into the condition, but you'd have to
make it a pre-op:

	} while (++i < NUM_PMKID_CACHE);

regards,
dan carpenter

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

end of thread, other threads:[~2017-08-31 12:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-31 11:33 [PATCH] staging:rtl8188eu:core Remove unneccessary else block Janani Sankara Babu
2017-08-31 12:09 ` Dan Carpenter

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

all inboxes | Powered by JetHome®