public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Lu Wei <luwei32@huawei.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, lars.povlsen@microchip.com,
	Steen.Hegelund@microchip.com, daniel.machon@microchip.com,
	UNGLinuxDriver@microchip.com, netdev@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init()
Date: Thu, 17 Nov 2022 15:08:06 +0100	[thread overview]
Message-ID: <Y3ZARsVC14JUa9i8@lunn.ch> (raw)
In-Reply-To: <20221117145820.2898968-1-luwei32@huawei.com>

On Thu, Nov 17, 2022 at 10:58:20PM +0800, Lu Wei wrote:
> There is no need to define variable ret, so remove it
> and return sparx5_leak_groups_init() directly.
> 
> Signed-off-by: Lu Wei <luwei32@huawei.com>
> ---
>  drivers/net/ethernet/microchip/sparx5/sparx5_qos.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
> index 1e79d0ef0cb8..2f39300d52cc 100644
> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
> @@ -383,13 +383,7 @@ static int sparx5_leak_groups_init(struct sparx5 *sparx5)
>  
>  int sparx5_qos_init(struct sparx5 *sparx5)
>  {
> -	int ret;
> -
> -	ret = sparx5_leak_groups_init(sparx5);
> -	if (ret < 0)
> -		return ret;
> -
> -	return 0;
> +	return sparx5_leak_groups_init(sparx5);
>  }

Does sparx5_qos_init() even make sense given that all it does it call
a function?

Please don't do the minimum needed to make your robot happy. Think
about the code, the change, is this the best fix?

      Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-11-17 14:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 14:58 [patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init() Lu Wei
2022-11-17 14:08 ` Andrew Lunn [this message]
2022-11-17 14:21 ` Daniel.Machon
2022-11-17 20:14   ` Andrew Lunn
2022-11-18  8:47     ` Daniel.Machon

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=Y3ZARsVC14JUa9i8@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=daniel.machon@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=lars.povlsen@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luwei32@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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