[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e267c38d-5ddd-244a-d083-9dbe4ed9973c@huawei.com>
Date: Tue, 11 May 2021 21:48:11 +0800
From: "Leizhen (ThunderTown)" <thunder.leizhen@...wei.com>
To: Andrew Lunn <andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>
CC: netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] net: forcedeth: Give bot handlers a helping hand
understanding the code
On 2021/5/11 20:43, Andrew Lunn wrote:
> Bots handlers repeatedly fail to understand nv_update_linkspeed() and
> submit patches unoptimizing it for the human reader. Add a comment to
> try to prevent this in the future.
>
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
> ---
> drivers/net/ethernet/nvidia/forcedeth.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
> index 8724d6a9ed02..0822b28f3b6a 100644
> --- a/drivers/net/ethernet/nvidia/forcedeth.c
> +++ b/drivers/net/ethernet/nvidia/forcedeth.c
> @@ -3475,6 +3475,9 @@ static int nv_update_linkspeed(struct net_device *dev)
> newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
> newdup = 0;
> } else {
> + /* Default to the same as 10/Half if we cannot
> + * determine anything else.
> + */
I think it would be better to remove the if branch above and then add comments here.
Otherwise, it becomes more and more redundant.
> newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
> newdup = 0;
> }
>
Powered by blists - more mailing lists