linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/net/usb/r8152: remove the unneeded variable "ret" in rtl8152_system_suspend
@ 2018-08-09  1:39 zhong jiang
  2018-08-09  2:28 ` Gustavo A. R. Silva
  2018-08-11 18:23 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: zhong jiang @ 2018-08-09  1:39 UTC (permalink / raw)
  To: davem, gustavo; +Cc: netdev, linux-kernel

rtl8152_system_suspend defines the variable "ret", but it is not modified
after initialization. So just remove it.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/net/usb/r8152.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 124211a..9774270 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -4415,7 +4415,6 @@ static int rtl8152_runtime_suspend(struct r8152 *tp)
 static int rtl8152_system_suspend(struct r8152 *tp)
 {
 	struct net_device *netdev = tp->netdev;
-	int ret = 0;
 
 	netif_device_detach(netdev);
 
@@ -4430,7 +4429,7 @@ static int rtl8152_system_suspend(struct r8152 *tp)
 		napi_enable(napi);
 	}
 
-	return ret;
+	return 0;
 }
 
 static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message)
-- 
1.7.12.4


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

* Re: [PATCH] drivers/net/usb/r8152: remove the unneeded variable "ret" in rtl8152_system_suspend
  2018-08-09  1:39 [PATCH] drivers/net/usb/r8152: remove the unneeded variable "ret" in rtl8152_system_suspend zhong jiang
@ 2018-08-09  2:28 ` Gustavo A. R. Silva
  2018-08-09  3:30   ` zhong jiang
  2018-08-11 18:23 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-09  2:28 UTC (permalink / raw)
  To: zhong jiang, davem; +Cc: netdev, linux-kernel

Hi Zhong,

On 8/8/18 8:39 PM, zhong jiang wrote:
> rtl8152_system_suspend defines the variable "ret", but it is not modified
> after initialization. So just remove it.
> 

Thanks for working on this.

I wonder if you are using any tool like Coccinelle to spot these sort
of issues. If so, it'd be nice to mention that in the changelog.

The above is important for two reasons, one is to give credit to the people
behind such tools, and the second one is to add support for metrics collection.

Thanks
--
Gustavo


> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  drivers/net/usb/r8152.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 124211a..9774270 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -4415,7 +4415,6 @@ static int rtl8152_runtime_suspend(struct r8152 *tp)
>  static int rtl8152_system_suspend(struct r8152 *tp)
>  {
>  	struct net_device *netdev = tp->netdev;
> -	int ret = 0;
>  
>  	netif_device_detach(netdev);
>  
> @@ -4430,7 +4429,7 @@ static int rtl8152_system_suspend(struct r8152 *tp)
>  		napi_enable(napi);
>  	}
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message)
> 

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

* Re: [PATCH] drivers/net/usb/r8152: remove the unneeded variable "ret" in rtl8152_system_suspend
  2018-08-09  2:28 ` Gustavo A. R. Silva
@ 2018-08-09  3:30   ` zhong jiang
  0 siblings, 0 replies; 4+ messages in thread
From: zhong jiang @ 2018-08-09  3:30 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: davem, netdev, linux-kernel

On 2018/8/9 10:28, Gustavo A. R. Silva wrote:
> Hi Zhong,
>
> On 8/8/18 8:39 PM, zhong jiang wrote:
>> rtl8152_system_suspend defines the variable "ret", but it is not modified
>> after initialization. So just remove it.
>>
> Thanks for working on this.
>
> I wonder if you are using any tool like Coccinelle to spot these sort
> of issues. If so, it'd be nice to mention that in the changelog.
 Yes, I use the returnval.cocci to spot it.  I will remember for next time.

 Thanks,
 zhong jiang
> The above is important for two reasons, one is to give credit to the people
> behind such tools, and the second one is to add support for metrics collection.
>
> Thanks
> --
> Gustavo
>
>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>>  drivers/net/usb/r8152.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
>> index 124211a..9774270 100644
>> --- a/drivers/net/usb/r8152.c
>> +++ b/drivers/net/usb/r8152.c
>> @@ -4415,7 +4415,6 @@ static int rtl8152_runtime_suspend(struct r8152 *tp)
>>  static int rtl8152_system_suspend(struct r8152 *tp)
>>  {
>>  	struct net_device *netdev = tp->netdev;
>> -	int ret = 0;
>>  
>>  	netif_device_detach(netdev);
>>  
>> @@ -4430,7 +4429,7 @@ static int rtl8152_system_suspend(struct r8152 *tp)
>>  		napi_enable(napi);
>>  	}
>>  
>> -	return ret;
>> +	return 0;
>>  }
>>  
>>  static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message)
>>
>



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

* Re: [PATCH] drivers/net/usb/r8152: remove the unneeded variable "ret" in rtl8152_system_suspend
  2018-08-09  1:39 [PATCH] drivers/net/usb/r8152: remove the unneeded variable "ret" in rtl8152_system_suspend zhong jiang
  2018-08-09  2:28 ` Gustavo A. R. Silva
@ 2018-08-11 18:23 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-08-11 18:23 UTC (permalink / raw)
  To: zhongjiang; +Cc: gustavo, netdev, linux-kernel

From: zhong jiang <zhongjiang@huawei.com>
Date: Thu, 9 Aug 2018 09:39:13 +0800

> rtl8152_system_suspend defines the variable "ret", but it is not modified
> after initialization. So just remove it.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

Applied.

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

end of thread, other threads:[~2018-08-11 20:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-09  1:39 [PATCH] drivers/net/usb/r8152: remove the unneeded variable "ret" in rtl8152_system_suspend zhong jiang
2018-08-09  2:28 ` Gustavo A. R. Silva
2018-08-09  3:30   ` zhong jiang
2018-08-11 18:23 ` David Miller

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).