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

Message ID 20230307085003.5025-2-straube.linux@gmail.com
State New
Headers
Series staging: r8188eu: two simple cleanups |

Commit Message

Michael Straube March 7, 2023, 8:50 a.m. UTC
  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@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_recv.c | 2 +-
 drivers/staging/r8188eu/core/rtw_xmit.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Patch

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;
 		}