2014-11-18 13:00:13

by Sudip Mukherjee

[permalink] [raw]
Subject: [PATCH] usbnet: rtl8150: remove unused variable

we were just returning the initial value of res, instead now
we are returning the value directly.

Signed-off-by: Sudip Mukherjee <[email protected]>
---
drivers/net/usb/rtl8150.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index 6e87e57..d37b7dc 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -753,14 +753,13 @@ static int rtl8150_open(struct net_device *netdev)
static int rtl8150_close(struct net_device *netdev)
{
rtl8150_t *dev = netdev_priv(netdev);
- int res = 0;

netif_stop_queue(netdev);
if (!test_bit(RTL8150_UNPLUG, &dev->flags))
disable_net_traffic(dev);
unlink_all_urbs(dev);

- return res;
+ return 0;
}

static void rtl8150_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *info)
--
1.8.1.2


2014-11-18 16:05:35

by Petko Manolov

[permalink] [raw]
Subject: Re: [PATCH] usbnet: rtl8150: remove unused variable

On 14-11-18 18:29:59, Sudip Mukherjee wrote:
> we were just returning the initial value of res, instead now
> we are returning the value directly.

Looks OK, but could you please fix the wording of the commit message to something like:

Remove unused variable.

This is a tiny patch and the code speaks for itself.


Petko


> Signed-off-by: Sudip Mukherjee <[email protected]>
> ---
> drivers/net/usb/rtl8150.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
> index 6e87e57..d37b7dc 100644
> --- a/drivers/net/usb/rtl8150.c
> +++ b/drivers/net/usb/rtl8150.c
> @@ -753,14 +753,13 @@ static int rtl8150_open(struct net_device *netdev)
> static int rtl8150_close(struct net_device *netdev)
> {
> rtl8150_t *dev = netdev_priv(netdev);
> - int res = 0;
>
> netif_stop_queue(netdev);
> if (!test_bit(RTL8150_UNPLUG, &dev->flags))
> disable_net_traffic(dev);
> unlink_all_urbs(dev);
>
> - return res;
> + return 0;
> }
>
> static void rtl8150_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *info)
> --
> 1.8.1.2
>