From: Heiner Kallweit <hkallweit1@gmail.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, davem@davemloft.net
Cc: kuba@kernel.org, linux-usb@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] asix: Use min() instead of doing it manually
Date: Sun, 26 Dec 2021 18:18:42 +0100 [thread overview]
Message-ID: <a82b56dc-8a74-cd6e-cfcb-9a16b858b21a@gmail.com> (raw)
In-Reply-To: <20211225170847.115298-1-jiapeng.chong@linux.alibaba.com>
On 25.12.2021 18:08, Jiapeng Chong wrote:
> Fix following coccicheck warning:
>
> ./drivers/net/usb/asix_common.c:545:12-13: WARNING opportunity for
> min().
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
> drivers/net/usb/asix_common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c
> index 71682970be58..da5a7df312d2 100644
> --- a/drivers/net/usb/asix_common.c
> +++ b/drivers/net/usb/asix_common.c
> @@ -542,7 +542,7 @@ static int __asix_mdio_write(struct net_device *netdev, int phy_id, int loc,
> out:
> mutex_unlock(&dev->phy_mutex);
>
> - return ret < 0 ? ret : 0;
> + return min(ret, 0);
Same comment as for a previous such patch. It doesn't make sense.
Also coccicheck isn't always right, please check whether a warning
is justified before sending a "fix".
> }
>
> void asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val)
prev parent reply other threads:[~2021-12-26 17:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-25 17:08 [PATCH] asix: Use min() instead of doing it manually Jiapeng Chong
2021-12-26 17:18 ` Heiner Kallweit [this message]
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=a82b56dc-8a74-cd6e-cfcb-9a16b858b21a@gmail.com \
--to=hkallweit1@gmail.com \
--cc=abaci@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@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 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.