All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] drivers:r8188eu: remove unneeded variable
@ 2021-08-25  6:15 CGEL
  2021-08-27 15:42 ` Pavel Skripkin
  0 siblings, 1 reply; 3+ messages in thread
From: CGEL @ 2021-08-25  6:15 UTC (permalink / raw)
  To: Larry Finger
  Cc: Phillip Potter, Greg Kroah-Hartman, Michael Straube,
	Martin Kaiser, linux-staging, linux-kernel, Jing Yangyang,
	Zeal Robot

From: Jing Yangyang <jing.yangyang@zte.com.cn>

Eliminate the following coccicheck warning:
./drivers/staging/r8188eu/os_dep/os_intfs.c:505:6-12:
 Unneeded variable "status". Return "_SUCCESS" on line 577
./drivers/staging/r8188eu/os_dep/os_intfs.c:772: 4-7:
  Unneeded variable "ret". Return "_SUCCESS" on line 818
./drivers/staging/r8188eu/os_dep/os_intfs.c:823:4-8:
Unneeded variable "ret8". Return "_SUCCESS" on line 849

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
---
 drivers/staging/r8188eu/os_dep/os_intfs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index 9d7d2b9..8436a43 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -502,7 +502,6 @@ void rtw_proc_remove_one(struct net_device *dev)
 
 static uint loadparam(struct adapter *padapter,  struct  net_device *pnetdev)
 {
-	uint status = _SUCCESS;
 	struct registry_priv  *registry_par = &padapter->registrypriv;
 
 	GlobalDebugLevel = rtw_debug;
@@ -574,7 +573,7 @@ static uint loadparam(struct adapter *padapter,  struct  net_device *pnetdev)
 	snprintf(registry_par->if2name, 16, "%s", if2name);
 	registry_par->notch_filter = (u8)rtw_notch_filter;
 
-	return status;
+	return _SUCCESS;
 }
 
 static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
@@ -751,7 +750,6 @@ void rtw_stop_drv_threads(struct adapter *padapter)
 
 static u8 rtw_init_default_value(struct adapter *padapter)
 {
-	u8 ret  = _SUCCESS;
 	struct registry_priv *pregistrypriv = &padapter->registrypriv;
 	struct xmit_priv	*pxmitpriv = &padapter->xmitpriv;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@@ -797,12 +795,11 @@ static u8 rtw_init_default_value(struct adapter *padapter)
 #ifdef CONFIG_88EU_P2P
 	padapter->bShowGetP2PState = 1;
 #endif
-	return ret;
+	return _SUCCESS;
 }
 
 u8 rtw_reset_drv_sw(struct adapter *padapter)
 {
-	u8	ret8 = _SUCCESS;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 	struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
 
@@ -828,7 +825,7 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
 
 	rtw_set_signal_stat_timer(&padapter->recvpriv);
 
-	return ret8;
+	return _SUCCESS;
 }
 
 u8 rtw_init_drv_sw(struct adapter *padapter)
-- 
1.8.3.1



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

* Re: [PATCH linux-next] drivers:r8188eu: remove unneeded variable
  2021-08-25  6:15 [PATCH linux-next] drivers:r8188eu: remove unneeded variable CGEL
@ 2021-08-27 15:42 ` Pavel Skripkin
  2021-08-27 15:48   ` Pavel Skripkin
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Skripkin @ 2021-08-27 15:42 UTC (permalink / raw)
  To: CGEL, Larry Finger
  Cc: Phillip Potter, Greg Kroah-Hartman, Michael Straube,
	Martin Kaiser, linux-staging, linux-kernel, Jing Yangyang,
	Zeal Robot

On 8/25/21 9:15 AM, CGEL wrote:
> From: Jing Yangyang <jing.yangyang@zte.com.cn>
> 
> Eliminate the following coccicheck warning:
> ./drivers/staging/r8188eu/os_dep/os_intfs.c:505:6-12:
>   Unneeded variable "status". Return "_SUCCESS" on line 577
> ./drivers/staging/r8188eu/os_dep/os_intfs.c:772: 4-7:
>    Unneeded variable "ret". Return "_SUCCESS" on line 818
> ./drivers/staging/r8188eu/os_dep/os_intfs.c:823:4-8:
> Unneeded variable "ret8". Return "_SUCCESS" on line 849
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
> ---
>   drivers/staging/r8188eu/os_dep/os_intfs.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
> index 9d7d2b9..8436a43 100644
> --- a/drivers/staging/r8188eu/os_dep/os_intfs.c
> +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
> @@ -502,7 +502,6 @@ void rtw_proc_remove_one(struct net_device *dev)
>   
>   static uint loadparam(struct adapter *padapter,  struct  net_device *pnetdev)
>   {
> -	uint status = _SUCCESS;
>   	struct registry_priv  *registry_par = &padapter->registrypriv;
>   
>   	GlobalDebugLevel = rtw_debug;
> @@ -574,7 +573,7 @@ static uint loadparam(struct adapter *padapter,  struct  net_device *pnetdev)
>   	snprintf(registry_par->if2name, 16, "%s", if2name);
>   	registry_par->notch_filter = (u8)rtw_notch_filter;
>   
> -	return status;
> +	return _SUCCESS;
>   }
>   

I suggest to make this function return void instead of always returning 
success

>   static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
> @@ -751,7 +750,6 @@ void rtw_stop_drv_threads(struct adapter *padapter)
>   
>   static u8 rtw_init_default_value(struct adapter *padapter)
>   {
> -	u8 ret  = _SUCCESS;
>   	struct registry_priv *pregistrypriv = &padapter->registrypriv;
>   	struct xmit_priv	*pxmitpriv = &padapter->xmitpriv;
>   	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
> @@ -797,12 +795,11 @@ static u8 rtw_init_default_value(struct adapter *padapter)
>   #ifdef CONFIG_88EU_P2P
>   	padapter->bShowGetP2PState = 1;
>   #endif
> -	return ret;
> +	return _SUCCESS;
>   }

same

>   
>   u8 rtw_reset_drv_sw(struct adapter *padapter)
>   {
> -	u8	ret8 = _SUCCESS;
>   	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
>   	struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
>   
> @@ -828,7 +825,7 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
>   
>   	rtw_set_signal_stat_timer(&padapter->recvpriv);
>   
> -	return ret8;
> +	return _SUCCESS;
>   }
>   
>   u8 rtw_init_drv_sw(struct adapter *padapter)
> 

same




With regards,
Pavel Skripkin

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

* Re: [PATCH linux-next] drivers:r8188eu: remove unneeded variable
  2021-08-27 15:42 ` Pavel Skripkin
@ 2021-08-27 15:48   ` Pavel Skripkin
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Skripkin @ 2021-08-27 15:48 UTC (permalink / raw)
  To: CGEL, Larry Finger
  Cc: Phillip Potter, Greg Kroah-Hartman, Michael Straube,
	Martin Kaiser, linux-staging, linux-kernel, Jing Yangyang,
	Zeal Robot

On 8/27/21 6:42 PM, Pavel Skripkin wrote:
> On 8/25/21 9:15 AM, CGEL wrote:
>> From: Jing Yangyang <jing.yangyang@zte.com.cn>
>> 
>> Eliminate the following coccicheck warning:
>> ./drivers/staging/r8188eu/os_dep/os_intfs.c:505:6-12:
>>   Unneeded variable "status". Return "_SUCCESS" on line 577
>> ./drivers/staging/r8188eu/os_dep/os_intfs.c:772: 4-7:
>>    Unneeded variable "ret". Return "_SUCCESS" on line 818
>> ./drivers/staging/r8188eu/os_dep/os_intfs.c:823:4-8:
>> Unneeded variable "ret8". Return "_SUCCESS" on line 849
>> 
>> Reported-by: Zeal Robot <zealci@zte.com.cn>
>> Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>

And, please, change subject line to "staging: r8188eu: ..." :)



With regards,
Pavel Skripkin

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

end of thread, other threads:[~2021-08-27 15:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25  6:15 [PATCH linux-next] drivers:r8188eu: remove unneeded variable CGEL
2021-08-27 15:42 ` Pavel Skripkin
2021-08-27 15:48   ` Pavel Skripkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.