lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3ZARsVC14JUa9i8@lunn.ch>
Date:   Thu, 17 Nov 2022 15:08:06 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Lu Wei <luwei32@...wei.com>
Cc:     davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, lars.povlsen@...rochip.com,
        Steen.Hegelund@...rochip.com, daniel.machon@...rochip.com,
        UNGLinuxDriver@...rochip.com, netdev@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [patch net-next] net: microchip: sparx5: remove useless code in
 sparx5_qos_init()

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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ