Skip to contentSkip to conversation

staging: rtl8723bs: simplify condition in rtw_btcoex_MediaStatusNotify

PATCH In review Zile Xiong 2 participants 2 messages Mar 19 Staging

lore
Share & tools
lore

Zile Xiong

author
#0 lore raw

PATCH 1/1 staging: rtl8723bs: simplify condition in rtw_btcoex_MediaStatusNotify

Remove redundant parentheses and unnecessary comparison to true in the conditional expression to improve readability.

No functional change.

---
 drivers/staging/rtl8723bs/core/rtw_btcoex.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8723bs/core/rtw_btcoex.c +1 -3
index f4b19ef7b341..b19eab0afba3 100644
@@ -10,10 +10,8 @@
 
 void rtw_btcoex_MediaStatusNotify(struct adapter *padapter, u8 media_status)
 {
-	if ((media_status == RT_MEDIA_CONNECT)
-		&& (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true)) {
+	if (media_status == RT_MEDIA_CONNECT && check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE))
 		rtw_hal_set_hwreg(padapter, HW_VAR_DL_RSVD_PAGE, NULL);
-	}
 
 	hal_btcoex_MediaStatusNotify(padapter, media_status);
 }
Signature · 1 line
2.39.5
maintainer
#1 lore raw
Quoted 15 lines · Zile Xiong

Remove redundant parentheses and unnecessary comparison to true in the conditional expression to improve readability.

No functional change.

---
 drivers/staging/rtl8723bs/core/rtw_btcoex.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8723bs/core/rtw_btcoex.c +0 -0
index f4b19ef7b341..b19eab0afba3 100644

drivers/staging/rtl8723bs/core/rtw_btcoex.c line 13

Quoted 6 lines
drivers/staging/rtl8723bs/core/rtw_btcoex.c +1 -2
@@ -10,10 +10,8 @@
 
 void rtw_btcoex_MediaStatusNotify(struct adapter *padapter, u8 media_status)
 {
-	if ((media_status == RT_MEDIA_CONNECT)
-		&& (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true)) {
+	if (media_status == RT_MEDIA_CONNECT && check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE))

Please no, now you need to remember that == takes precidence over &&.

drivers/staging/rtl8723bs/core/rtw_btcoex.c line 16

Quoted 2 lines
drivers/staging/rtl8723bs/core/rtw_btcoex.c +0 -1
 		rtw_hal_set_hwreg(padapter, HW_VAR_DL_RSVD_PAGE, NULL);
-	}

You also did two different things here in the same change, which isn't alowed for staging patches.

thanks,

greg k-h