net/mlx5: E-Switch, remove redundant else statements
authorSaeed Mahameed <saeedm@nvidia.com>
Wed, 7 Jun 2023 21:12:10 +0000 (14:12 -0700)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 16 Jun 2023 19:02:07 +0000 (12:02 -0700)
These else statement blocks are redundant since the if block already
jumps to the function abort label.

Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c

index fabe49a..255bc8b 100644 (file)
@@ -285,9 +285,8 @@ static int _mlx5_eswitch_set_vepa_locked(struct mlx5_eswitch *esw,
        if (IS_ERR(flow_rule)) {
                err = PTR_ERR(flow_rule);
                goto out;
-       } else {
-               esw->fdb_table.legacy.vepa_uplink_rule = flow_rule;
        }
+       esw->fdb_table.legacy.vepa_uplink_rule = flow_rule;
 
        /* Star rule to forward all traffic to uplink vport */
        memset(&dest, 0, sizeof(dest));
@@ -299,9 +298,8 @@ static int _mlx5_eswitch_set_vepa_locked(struct mlx5_eswitch *esw,
        if (IS_ERR(flow_rule)) {
                err = PTR_ERR(flow_rule);
                goto out;
-       } else {
-               esw->fdb_table.legacy.vepa_star_rule = flow_rule;
        }
+       esw->fdb_table.legacy.vepa_star_rule = flow_rule;
 
 out:
        kvfree(spec);