Skip to content

Commit cc70267

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum_router: Return void from deletion functions
There is no point in returning a value from function whose return value is never checked. Even if the return value was checked, there wouldn't be anything to do about it, as these functions are either called from error or deletion paths. Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4db93fb commit cc70267

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -505,15 +505,15 @@ static int mlxsw_sp_lpm_tree_alloc(struct mlxsw_sp *mlxsw_sp,
505505
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralta), ralta_pl);
506506
}
507507

508-
static int mlxsw_sp_lpm_tree_free(struct mlxsw_sp *mlxsw_sp,
509-
struct mlxsw_sp_lpm_tree *lpm_tree)
508+
static void mlxsw_sp_lpm_tree_free(struct mlxsw_sp *mlxsw_sp,
509+
struct mlxsw_sp_lpm_tree *lpm_tree)
510510
{
511511
char ralta_pl[MLXSW_REG_RALTA_LEN];
512512

513513
mlxsw_reg_ralta_pack(ralta_pl, false,
514514
(enum mlxsw_reg_ralxx_protocol) lpm_tree->proto,
515515
lpm_tree->id);
516-
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralta), ralta_pl);
516+
mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralta), ralta_pl);
517517
}
518518

519519
static int
@@ -569,10 +569,10 @@ mlxsw_sp_lpm_tree_create(struct mlxsw_sp *mlxsw_sp,
569569
return ERR_PTR(err);
570570
}
571571

572-
static int mlxsw_sp_lpm_tree_destroy(struct mlxsw_sp *mlxsw_sp,
573-
struct mlxsw_sp_lpm_tree *lpm_tree)
572+
static void mlxsw_sp_lpm_tree_destroy(struct mlxsw_sp *mlxsw_sp,
573+
struct mlxsw_sp_lpm_tree *lpm_tree)
574574
{
575-
return mlxsw_sp_lpm_tree_free(mlxsw_sp, lpm_tree);
575+
mlxsw_sp_lpm_tree_free(mlxsw_sp, lpm_tree);
576576
}
577577

578578
static struct mlxsw_sp_lpm_tree *
@@ -601,12 +601,11 @@ mlxsw_sp_lpm_tree_get(struct mlxsw_sp *mlxsw_sp,
601601
return lpm_tree;
602602
}
603603

604-
static int mlxsw_sp_lpm_tree_put(struct mlxsw_sp *mlxsw_sp,
605-
struct mlxsw_sp_lpm_tree *lpm_tree)
604+
static void mlxsw_sp_lpm_tree_put(struct mlxsw_sp *mlxsw_sp,
605+
struct mlxsw_sp_lpm_tree *lpm_tree)
606606
{
607607
if (--lpm_tree->ref_count == 0)
608-
return mlxsw_sp_lpm_tree_destroy(mlxsw_sp, lpm_tree);
609-
return 0;
608+
mlxsw_sp_lpm_tree_destroy(mlxsw_sp, lpm_tree);
610609
}
611610

612611
#define MLXSW_SP_LPM_TREE_MIN 1 /* tree 0 is reserved */

0 commit comments

Comments
 (0)