2023-03-07 08:50:20

by Michael Straube

[permalink] [raw]
Subject: [PATCH 0/2] 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(-)

--
2.39.2



2023-03-07 08:50:24

by Michael Straube

[permalink] [raw]
Subject: [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.

Signed-off-by: Michael Straube <[email protected]>
---
drivers/staging/r8188eu/core/rtw_recv.c | 2 +-
drivers/staging/r8188eu/core/rtw_xmit.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index fc7568cf948b..741c17121c9b 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -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) {
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index df88b3e29e77..cc3894101673 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -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;
}
--
2.39.2


2023-03-07 08:50:29

by Michael Straube

[permalink] [raw]
Subject: [PATCH 2/2] staging: r8188eu: bgrpkey_handshake is set but never used

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

Signed-off-by: Michael Straube <[email protected]>
---
drivers/staging/r8188eu/core/rtw_mlme.c | 1 -
drivers/staging/r8188eu/include/rtw_security.h | 1 -
2 files changed, 2 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
index fb7d0e161fdd..809ac0317db2 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme.c
@@ -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));
diff --git a/drivers/staging/r8188eu/include/rtw_security.h b/drivers/staging/r8188eu/include/rtw_security.h
index 783ae18a122a..8c187de7a522 100644
--- a/drivers/staging/r8188eu/include/rtw_security.h
+++ b/drivers/staging/r8188eu/include/rtw_security.h
@@ -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
--
2.39.2


2023-03-07 19:26:32

by Philipp Hortmann

[permalink] [raw]
Subject: Re: [PATCH 0/2] staging: r8188eu: two simple cleanups

On 3/7/23 09:50, Michael Straube wrote:
> 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(-)
>

Tested-by: Philipp Hortmann <[email protected]> # Edimax N150

2023-03-09 09:09:48

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 0/2] staging: r8188eu: two simple cleanups

On Tue, Mar 07, 2023 at 09:50:01AM +0100, Michael Straube wrote:
> 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(-)
>
> --
> 2.39.2
>
>

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

greg k-h