All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] staging: rtl8723bs: core: Remove unused variable 'res'
@ 2021-03-31  8:12 Xu Jia
  2021-03-31  8:49 ` Dan Carpenter
  2021-03-31 10:29 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 3+ messages in thread
From: Xu Jia @ 2021-03-31  8:12 UTC (permalink / raw)
  To: xujia39, Greg Kroah-Hartman, Ross Schmidt, Amarjargal Gundjalam,
	Jason Yan
  Cc: linux-staging, linux-kernel, kernel-janitors

The variable 'res' is not used in function, this commit
remove it to fix the warning.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Xu Jia <xujia39@huawei.com>
---
 drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
index f96dd0b40e04..00b83919a9a3 100644
--- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
@@ -533,7 +533,6 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
 u32 rtw_init_bcmc_stainfo(struct adapter *padapter)
 {
 	struct sta_info *psta;
-	u32 res = _SUCCESS;
 	NDIS_802_11_MAC_ADDRESS	bcast_addr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
 	struct	sta_priv *pstapriv = &padapter->stapriv;
@@ -542,15 +541,12 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter)
 	psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
 
 	if (!psta) {
-		res = _FAIL;
 		RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("rtw_alloc_stainfo fail"));
-		goto exit;
+		return _FAIL;
 	}
 
 	/*  default broadcast & multicast use macid 1 */
 	psta->mac_id = 1;
-
-exit:
 	return _SUCCESS;
 }
 


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

* Re: [PATCH -next] staging: rtl8723bs: core: Remove unused variable 'res'
  2021-03-31  8:12 [PATCH -next] staging: rtl8723bs: core: Remove unused variable 'res' Xu Jia
@ 2021-03-31  8:49 ` Dan Carpenter
  2021-03-31 10:29 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-03-31  8:49 UTC (permalink / raw)
  To: Xu Jia
  Cc: Greg Kroah-Hartman, Ross Schmidt, Amarjargal Gundjalam,
	Jason Yan, linux-staging, linux-kernel, kernel-janitors

I've been rejecting these patches until someone updates the callers to
check the return.  This patch just silences the warning but the code is
still totally buggy.

regards,
dan carpenter


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

* Re: [PATCH -next] staging: rtl8723bs: core: Remove unused variable 'res'
  2021-03-31  8:12 [PATCH -next] staging: rtl8723bs: core: Remove unused variable 'res' Xu Jia
  2021-03-31  8:49 ` Dan Carpenter
@ 2021-03-31 10:29 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2021-03-31 10:29 UTC (permalink / raw)
  To: Xu Jia
  Cc: Ross Schmidt, Amarjargal Gundjalam, Jason Yan, linux-staging,
	linux-kernel, kernel-janitors

On Wed, Mar 31, 2021 at 04:12:43PM +0800, Xu Jia wrote:
> The variable 'res' is not used in function, this commit
> remove it to fix the warning.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Xu Jia <xujia39@huawei.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> index f96dd0b40e04..00b83919a9a3 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
> @@ -533,7 +533,6 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
>  u32 rtw_init_bcmc_stainfo(struct adapter *padapter)
>  {
>  	struct sta_info *psta;
> -	u32 res = _SUCCESS;
>  	NDIS_802_11_MAC_ADDRESS	bcast_addr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
>  
>  	struct	sta_priv *pstapriv = &padapter->stapriv;
> @@ -542,15 +541,12 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter)
>  	psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
>  
>  	if (!psta) {
> -		res = _FAIL;
>  		RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("rtw_alloc_stainfo fail"));
> -		goto exit;
> +		return _FAIL;

You just changed the logic here, that's not a good thing for a "robot"
to be doing at all.

greg k-h

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

end of thread, other threads:[~2021-03-31 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31  8:12 [PATCH -next] staging: rtl8723bs: core: Remove unused variable 'res' Xu Jia
2021-03-31  8:49 ` Dan Carpenter
2021-03-31 10:29 ` Greg Kroah-Hartman

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.