Skip to contentSkip to conversation

staging:rtl8188eu:core Remove unneccessary else block

PATCH Superseded Janani Sankara Babu 2 participants 2 messages Aug 31, 2017 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging:rtl8188eu:core Remove unneccessary else block

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

---
 drivers/staging/rtl8188eu/core/rtw_mlme.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/staging/rtl8188eu/core/rtw_mlme.c +3 -6
index d3668ca..8480d30 100644
@@ -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)
Signature · 1 line
1.9.1
#1 lore raw
Quoted 16 lines · Janani Sankara Babu

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

---
 drivers/staging/rtl8188eu/core/rtw_mlme.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/staging/rtl8188eu/core/rtw_mlme.c +0 -0
index d3668ca..8480d30 100644
@@ -1708,13 +1708,10 @@ static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid)
 
 	do {
 		if ((psecuritypriv->PMKIDList[i].bUsed) &&

drivers/staging/rtl8188eu/core/rtw_mlme.c static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid) · line 1714

Quoted 10 lines
drivers/staging/rtl8188eu/core/rtw_mlme.c +3 -6
-		    (!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.

drivers/staging/rtl8188eu/core/rtw_mlme.c static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid) · line 1715

Quoted 1 line
drivers/staging/rtl8188eu/core/rtw_mlme.c +0 -0
 	} 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