Skip to contentSkip to conversation

staging: rtl8723bs: os_dep: Remove conditions with no effects

PATCH Superseded Fabio M. De Francesco 3 participants 3 messages Jun 6, 2021 – Jun 9, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: rtl8723bs: os_dep: Remove conditions with no effects

Removed conditions with no effects. Detected by Coccinelle. It seems that these conditions with no effects had been inadvertently left while deleting code that had to be conditionally compiled by unused definition CONFIG_AP_WOWLAN (see commit dc365d2cc579).

---

v1 -> v2: Rewrote the changelog according to suggestion by Joe Perches <[email protected]>

 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +2 -9
index 213ec5b4ce98..2035573ee5a0 100644
@@ -1187,10 +1187,7 @@ void rtw_suspend_common(struct adapter *padapter)
 
 	rtw_ps_deny_cancel(padapter, PS_DENY_SUSPEND);
 
-	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
-		rtw_suspend_normal(padapter);
-	else
-		rtw_suspend_normal(padapter);
+	rtw_suspend_normal(padapter);
 
 	netdev_dbg(padapter->pnetdev, "rtw suspend success in %d ms\n",
 		   jiffies_to_msecs(jiffies - start_time));
@@ -1268,11 +1265,7 @@ int rtw_resume_common(struct adapter *padapter)
 
 	netdev_dbg(padapter->pnetdev, "resume start\n");
 
-	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
-		rtw_resume_process_normal(padapter);
-	} else {
-		rtw_resume_process_normal(padapter);
-	}
+	rtw_resume_process_normal(padapter);
 
 	hal_btcoex_SuspendNotify(padapter, 0);
 
Signature · 1 line
2.31.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 47 lines · Fabio M. De Francesco

Removed conditions with no effects. Detected by Coccinelle. It seems that these conditions with no effects had been inadvertently left while deleting code that had to be conditionally compiled by unused definition CONFIG_AP_WOWLAN (see commit dc365d2cc579).

---

v1 -> v2: Rewrote the changelog according to suggestion by Joe Perches <[email protected]>

 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +2 -9
index 213ec5b4ce98..2035573ee5a0 100644
@@ -1187,10 +1187,7 @@ void rtw_suspend_common(struct adapter *padapter)
 
 	rtw_ps_deny_cancel(padapter, PS_DENY_SUSPEND);
 
-	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
-		rtw_suspend_normal(padapter);
-	else
-		rtw_suspend_normal(padapter);
+	rtw_suspend_normal(padapter);
 
 	netdev_dbg(padapter->pnetdev, "rtw suspend success in %d ms\n",
 		   jiffies_to_msecs(jiffies - start_time));
@@ -1268,11 +1265,7 @@ int rtw_resume_common(struct adapter *padapter)
 
 	netdev_dbg(padapter->pnetdev, "resume start\n");
 
-	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
-		rtw_resume_process_normal(padapter);
-	} else {
-		rtw_resume_process_normal(padapter);
-	}
+	rtw_resume_process_normal(padapter);
 
 	hal_btcoex_SuspendNotify(padapter, 0);
 
Signature · 1 line
2.31.1

Thank you Fabio :)

#2 lore raw
In reply to Fabio M. De Francesco
Quoted 45 lines · Fabio M. De Francesco

Removed conditions with no effects. Detected by Coccinelle. It seems that these conditions with no effects had been inadvertently left while deleting code that had to be conditionally compiled by unused definition CONFIG_AP_WOWLAN (see commit dc365d2cc579).

---

v1 -> v2: Rewrote the changelog according to suggestion by Joe Perches <[email protected]>

 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +2 -9
index 213ec5b4ce98..2035573ee5a0 100644
@@ -1187,10 +1187,7 @@ void rtw_suspend_common(struct adapter *padapter)
 
 	rtw_ps_deny_cancel(padapter, PS_DENY_SUSPEND);
 
-	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
-		rtw_suspend_normal(padapter);
-	else
-		rtw_suspend_normal(padapter);
+	rtw_suspend_normal(padapter);
 
 	netdev_dbg(padapter->pnetdev, "rtw suspend success in %d ms\n",
 		   jiffies_to_msecs(jiffies - start_time));
@@ -1268,11 +1265,7 @@ int rtw_resume_common(struct adapter *padapter)
 
 	netdev_dbg(padapter->pnetdev, "resume start\n");
 
-	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
-		rtw_resume_process_normal(padapter);
-	} else {
-		rtw_resume_process_normal(padapter);
-	}
+	rtw_resume_process_normal(padapter);
 
 	hal_btcoex_SuspendNotify(padapter, 0);
 
Signature · 1 line
2.31.1

This patch adds a build warning:

drivers/staging/rtl8723bs/os_dep/os_intfs.c: In function ‘rtw_resume_common’:
drivers/staging/rtl8723bs/os_dep/os_intfs.c:1264:27: warning: unused variable ‘pmlmepriv’ [-Wunused-variable]

 1264 |         struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
      |                           ^~~~~~~~~

LD [M] drivers/staging/rtl8723bs/r8723bs.o

So I can not take it, please fix up and resend.

thanks,

greg k-h