Skip to contentSkip to conversation

staging: r8188eu: two simple cleanups

PATCH In review Michael Straube 3 participants 5 messages Mar 7, 2023 – Mar 9, 2023 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: r8188eu: two simple cleanups

This series contains two simple cleanups.

Tested on x86_64 with Inter-Tech DMG-02.

Michael Straube (2):
staging: r8188eu: busetkipkey is boolean
staging: r8188eu: bgrpkey_handshake is set but never used

 drivers/staging/r8188eu/core/rtw_mlme.c        | 1 -
 drivers/staging/r8188eu/core/rtw_recv.c        | 2 +-
 drivers/staging/r8188eu/core/rtw_xmit.c        | 2 +-
 drivers/staging/r8188eu/include/rtw_security.h | 1 -
 4 files changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/2 staging: r8188eu: busetkipkey is boolean

The field busetkipkey of struct security_priv is set to boolean values only. Remove unneeded comparisions from if statements that use this field.

---
 drivers/staging/r8188eu/core/rtw_recv.c | 2 +-
 drivers/staging/r8188eu/core/rtw_xmit.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/core/rtw_recv.c +1 -1
index fc7568cf948b..741c17121c9b 100644
@@ -471,7 +471,7 @@ static struct recv_frame *decryptor(struct adapter *padapter, struct recv_frame
 			break;
 		}
 	} else if (prxattrib->bdecrypted == 1 && prxattrib->encrypt > 0 &&
-		   (psecuritypriv->busetkipkey == 1 || prxattrib->encrypt != _TKIP_))
+		   (psecuritypriv->busetkipkey || prxattrib->encrypt != _TKIP_))
 			psecuritypriv->hw_decrypted = true;
 
 	if (res == _FAIL) {
drivers/staging/r8188eu/core/rtw_xmit.c +1 -1
index df88b3e29e77..cc3894101673 100644
@@ -626,7 +626,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
 		pattrib->iv_len = 8;
 		pattrib->icv_len = 4;
 
-		if (padapter->securitypriv.busetkipkey == _FAIL) {
+		if (!padapter->securitypriv.busetkipkey) {
 			res = _FAIL;
 			goto exit;
 		}
Signature · 1 line
2.39.2
#2 lore raw

PATCH 2/2 staging: r8188eu: bgrpkey_handshake is set but never used

In reply to Michael Straube

The field bgrpkey_handshake of struct security_priv is set but never used. Remove it.

---
 drivers/staging/r8188eu/core/rtw_mlme.c        | 1 -
 drivers/staging/r8188eu/include/rtw_security.h | 1 -
 2 files changed, 2 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme.c +0 -1
index fb7d0e161fdd..809ac0317db2 100644
@@ -944,7 +944,6 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
 		if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
 			padapter->securitypriv.binstallGrpkey = false;
 			padapter->securitypriv.busetkipkey = false;
-			padapter->securitypriv.bgrpkey_handshake = false;
 			psta->ieee8021x_blocked = true;
 			psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
 			memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype));
drivers/staging/r8188eu/include/rtw_security.h +0 -1
index 783ae18a122a..8c187de7a522 100644
@@ -116,7 +116,6 @@ struct security_priv {
 	u8	binstallGrpkey;
 	u8	busetkipkey;
 	u8	bcheck_grpkey;
-	u8	bgrpkey_handshake;
 	s32	sw_encrypt;/* from registry_priv */
 	s32	sw_decrypt;/* from registry_priv */
 	s32	hw_decrypted;/* if the rx packets is hw_decrypted==false,i
Signature · 1 line
2.39.2
Tested-by on the v1 series
#3 lore raw
In reply to Michael Straube
Quoted 8 lines · Michael Straube

This series contains two simple cleanups.

Tested on x86_64 with Inter-Tech DMG-02.

Michael Straube (2):
staging: r8188eu: busetkipkey is boolean
staging: r8188eu: bgrpkey_handshake is set but never used

Quoted 6 lines
  drivers/staging/r8188eu/core/rtw_mlme.c        | 1 -
  drivers/staging/r8188eu/core/rtw_recv.c        | 2 +-
  drivers/staging/r8188eu/core/rtw_xmit.c        | 2 +-
  drivers/staging/r8188eu/include/rtw_security.h | 1 -
  4 files changed, 2 insertions(+), 4 deletions(-)
maintainer
#4 lore raw
In reply to Michael Straube
Quoted 8 lines · Michael Straube

This series contains two simple cleanups.

Tested on x86_64 with Inter-Tech DMG-02.

Michael Straube (2):
staging: r8188eu: busetkipkey is boolean
staging: r8188eu: bgrpkey_handshake is set but never used

Quoted 10 lines
 drivers/staging/r8188eu/core/rtw_mlme.c        | 1 -
 drivers/staging/r8188eu/core/rtw_recv.c        | 2 +-
 drivers/staging/r8188eu/core/rtw_xmit.c        | 2 +-
 drivers/staging/r8188eu/include/rtw_security.h | 1 -
 4 files changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
2.39.2

Sorry, but I've now deleted this driver, so these patches do not apply.

greg k-h