From: zhong jiang <zhongjiang@huawei.com>
To: <davem@davemloft.net>, <edumazet@google.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers/net/usb/r8152: change rtl8152_system_suspend to be void function
Date: Thu, 9 Aug 2018 09:42:45 +0800 [thread overview]
Message-ID: <5B6B9C15.4050106@huawei.com> (raw)
In-Reply-To: <1533738407-10495-1-git-send-email-zhongjiang@huawei.com>
Igore the patch, will repost, Thanks
On 2018/8/8 22:26, zhong jiang wrote:
> rtl8152_system_suspend defines the variable "ret", but it is not modified
> after initialization. Further, I find that any of the callees do not
> handle the return value. So It is safe to drop the variable and make it to
> be void function.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
> drivers/net/usb/r8152.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 124211a..cc51ac8 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -4412,10 +4412,9 @@ static int rtl8152_runtime_suspend(struct r8152 *tp)
> return ret;
> }
>
> -static int rtl8152_system_suspend(struct r8152 *tp)
> +static void rtl8152_system_suspend(struct r8152 *tp)
> {
> struct net_device *netdev = tp->netdev;
> - int ret = 0;
>
> netif_device_detach(netdev);
>
> @@ -4429,8 +4428,6 @@ static int rtl8152_system_suspend(struct r8152 *tp)
> tp->rtl_ops.down(tp);
> napi_enable(napi);
> }
> -
> - return ret;
> }
>
> static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message)
> @@ -4443,7 +4440,7 @@ static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message)
> if (PMSG_IS_AUTO(message))
> ret = rtl8152_runtime_suspend(tp);
> else
> - ret = rtl8152_system_suspend(tp);
> + rtl8152_system_suspend(tp);
>
> mutex_unlock(&tp->control);
>
next prev parent reply other threads:[~2018-08-09 1:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-08 14:26 [PATCH] drivers/net/usb/r8152: change rtl8152_system_suspend to be void function zhong jiang
2018-08-09 1:42 ` zhong jiang [this message]
2018-08-09 3:47 ` kbuild test robot
2018-08-12 22:09 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5B6B9C15.4050106@huawei.com \
--to=zhongjiang@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox