linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] staging: rtl8723bs: os_dep: Remove conditions with no effects
@ 2021-06-06  7:42 Fabio M. De Francesco
  2021-06-07 14:49 ` Fabio Aiuto
  2021-06-09 12:25 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio M. De Francesco @ 2021-06-06  7:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Joe Perches, linux-staging, linux-kernel
  Cc: 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).

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---

v1 -> v2: Rewrote the changelog according to suggestion by 
Joe Perches <joe@perches.com>

 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 213ec5b4ce98..2035573ee5a0 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -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);
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] staging: rtl8723bs: os_dep: Remove conditions with no effects
  2021-06-06  7:42 [PATCH v2] staging: rtl8723bs: os_dep: Remove conditions with no effects Fabio M. De Francesco
@ 2021-06-07 14:49 ` Fabio Aiuto
  2021-06-09 12:25 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Fabio Aiuto @ 2021-06-07 14:49 UTC (permalink / raw)
  To: Fabio M. De Francesco
  Cc: Greg Kroah-Hartman, Joe Perches, linux-staging, linux-kernel

On Sun, Jun 06, 2021 at 09:42:16AM +0200, Fabio M. De Francesco wrote:
> 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).
> 
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
> 
> v1 -> v2: Rewrote the changelog according to suggestion by 
> Joe Perches <joe@perches.com>
> 
>  drivers/staging/rtl8723bs/os_dep/os_intfs.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> index 213ec5b4ce98..2035573ee5a0 100644
> --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> @@ -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);
>  
> -- 
> 2.31.1
> 
> 

Thank you Fabio :)

Reviewed-by: Fabio Aiuto <fabioaiuto83@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] staging: rtl8723bs: os_dep: Remove conditions with no effects
  2021-06-06  7:42 [PATCH v2] staging: rtl8723bs: os_dep: Remove conditions with no effects Fabio M. De Francesco
  2021-06-07 14:49 ` Fabio Aiuto
@ 2021-06-09 12:25 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-06-09 12:25 UTC (permalink / raw)
  To: Fabio M. De Francesco; +Cc: Joe Perches, linux-staging, linux-kernel

On Sun, Jun 06, 2021 at 09:42:16AM +0200, Fabio M. De Francesco wrote:
> 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).
> 
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
> 
> v1 -> v2: Rewrote the changelog according to suggestion by 
> Joe Perches <joe@perches.com>
> 
>  drivers/staging/rtl8723bs/os_dep/os_intfs.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> index 213ec5b4ce98..2035573ee5a0 100644
> --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> @@ -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);
>  
> -- 
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] staging: rtl8723bs: os_dep: Remove conditions with no effects
@ 2021-06-09 13:23 Fabio M. De Francesco
  0 siblings, 0 replies; 4+ messages in thread
From: Fabio M. De Francesco @ 2021-06-09 13:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Joe Perches, Fabio Aiuto, linux-staging,
	linux-kernel
  Cc: Fabio M. De Francesco

Removed conditions with no effects. Detected by Coccinelle.
Deleted a variable that is no longer used because of the above-mentioned
removals.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Reviewed-by: Fabio Aiuto <fabioaiuto83@gmail.com>
---

v1->v2: As reported by Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
deleted a variable that became unused because of the removal of the
conditions.

 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 213ec5b4ce98..11b9a5919da4 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -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));
@@ -1264,15 +1261,10 @@ int rtw_resume_common(struct adapter *padapter)
 	int ret = 0;
 	unsigned long start_time = jiffies;
 	struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
-	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
 	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);
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-09 13:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-06  7:42 [PATCH v2] staging: rtl8723bs: os_dep: Remove conditions with no effects Fabio M. De Francesco
2021-06-07 14:49 ` Fabio Aiuto
2021-06-09 12:25 ` Greg Kroah-Hartman
2021-06-09 13:23 Fabio M. De Francesco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).