[patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init()

Daniel.Machon at microchip.com Daniel.Machon at microchip.com
Thu Nov 17 06:21:14 PST 2022


Den Thu, Nov 17, 2022 at 10:58:20PM +0800 skrev Lu Wei:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> There is no need to define variable ret, so remove it
> and return sparx5_leak_groups_init() directly.
> 
> Signed-off-by: Lu Wei <luwei32 at 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);
>  }
> 
>  int sparx5_tc_mqprio_add(struct net_device *ndev, u8 num_tc)
> --
> 2.31.1
>

sparx5_qos_init() will be expanded in later patch series, as new QoS
features require new initializations - so this is actually somewhat
intentional.

/ Daniel



More information about the linux-arm-kernel mailing list