[PATCH 1/2] staging: r8188eu: busetkipkey is boolean

From: Michael Straube
Date: Tue Mar 07 2023 - 03:50:24 EST


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 <straube.linux@xxxxxxxxx>
---
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