All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] staging: rtl8723bs: os_dep: remove unused variable 'ret'
@ 2021-03-31  9:42 Yang Yingliang
  2021-03-31 10:27 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Yang Yingliang @ 2021-03-31  9:42 UTC (permalink / raw)
  To: linux-kernel, linux-staging; +Cc: gregkh

GCC reports the following warning with W=1:

drivers/staging/rtl8723bs/os_dep/recv_linux.c:101:6: warning:
 variable ‘ret’ set but not used [-Wunused-but-set-variable]
  101 |  int ret;
      |      ^~~

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

Fixes: de69e2b3f105 ("staging: rtl8723bs: remove DBG_COUNTER calls from os_dep/recv_linux.c")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/staging/rtl8723bs/os_dep/recv_linux.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index fbdbcd04d44a..f6a9482be8e3 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -98,7 +98,6 @@ struct sk_buff *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_L
 void rtw_os_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, struct rx_pkt_attrib *pattrib)
 {
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-	int ret;
 
 	/* Indicate the packets to upper layer */
 	if (pkt) {
@@ -140,7 +139,7 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, str
 
 		pkt->ip_summed = CHECKSUM_NONE;
 
-		ret = rtw_netif_rx(padapter->pnetdev, pkt);
+		rtw_netif_rx(padapter->pnetdev, pkt);
 	}
 }
 
-- 
2.25.1


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

* Re: [PATCH -next] staging: rtl8723bs: os_dep: remove unused variable 'ret'
  2021-03-31  9:42 [PATCH -next] staging: rtl8723bs: os_dep: remove unused variable 'ret' Yang Yingliang
@ 2021-03-31 10:27 ` Greg KH
  2021-04-01  2:35   ` Yang Yingliang
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2021-03-31 10:27 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, linux-staging

On Wed, Mar 31, 2021 at 05:42:47PM +0800, Yang Yingliang wrote:
> GCC reports the following warning with W=1:
> 
> drivers/staging/rtl8723bs/os_dep/recv_linux.c:101:6: warning:
>  variable ‘ret’ set but not used [-Wunused-but-set-variable]
>   101 |  int ret;
>       |      ^~~
> 
> This variable is not used in function , this commit
> remove it to fix the warning.
> 
> Fixes: de69e2b3f105 ("staging: rtl8723bs: remove DBG_COUNTER calls from os_dep/recv_linux.c")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/staging/rtl8723bs/os_dep/recv_linux.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
> index fbdbcd04d44a..f6a9482be8e3 100644
> --- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
> +++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
> @@ -98,7 +98,6 @@ struct sk_buff *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_L
>  void rtw_os_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, struct rx_pkt_attrib *pattrib)
>  {
>  	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
> -	int ret;
>  
>  	/* Indicate the packets to upper layer */
>  	if (pkt) {
> @@ -140,7 +139,7 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, str
>  
>  		pkt->ip_summed = CHECKSUM_NONE;
>  
> -		ret = rtw_netif_rx(padapter->pnetdev, pkt);
> +		rtw_netif_rx(padapter->pnetdev, pkt);

Why not handle the result of this call properly?


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

* Re: [PATCH -next] staging: rtl8723bs: os_dep: remove unused variable 'ret'
  2021-03-31 10:27 ` Greg KH
@ 2021-04-01  2:35   ` Yang Yingliang
  0 siblings, 0 replies; 3+ messages in thread
From: Yang Yingliang @ 2021-04-01  2:35 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, linux-staging

Hi,

On 2021/3/31 18:27, Greg KH wrote:
> On Wed, Mar 31, 2021 at 05:42:47PM +0800, Yang Yingliang wrote:
>> GCC reports the following warning with W=1:
>>
>> drivers/staging/rtl8723bs/os_dep/recv_linux.c:101:6: warning:
>>   variable ‘ret’ set but not used [-Wunused-but-set-variable]
>>    101 |  int ret;
>>        |      ^~~
>>
>> This variable is not used in function , this commit
>> remove it to fix the warning.
>>
>> Fixes: de69e2b3f105 ("staging: rtl8723bs: remove DBG_COUNTER calls from os_dep/recv_linux.c")
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>>   drivers/staging/rtl8723bs/os_dep/recv_linux.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
>> index fbdbcd04d44a..f6a9482be8e3 100644
>> --- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
>> +++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
>> @@ -98,7 +98,6 @@ struct sk_buff *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_L
>>   void rtw_os_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, struct rx_pkt_attrib *pattrib)
>>   {
>>   	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
>> -	int ret;
>>   
>>   	/* Indicate the packets to upper layer */
>>   	if (pkt) {
>> @@ -140,7 +139,7 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, str
>>   
>>   		pkt->ip_summed = CHECKSUM_NONE;
>>   
>> -		ret = rtw_netif_rx(padapter->pnetdev, pkt);
>> +		rtw_netif_rx(padapter->pnetdev, pkt);
> Why not handle the result of this call properly?

The return type of rtw_os_recv_indicate_pkt() is void, it can't use this 
return code.

I will try to make a patch to change return type of 
rtw_os_recv_indicate_pkt() to use
this return code later.

Thanks,

Yang

>
> .

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

end of thread, other threads:[~2021-04-01  2:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31  9:42 [PATCH -next] staging: rtl8723bs: os_dep: remove unused variable 'ret' Yang Yingliang
2021-03-31 10:27 ` Greg KH
2021-04-01  2:35   ` Yang Yingliang

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.