You need to sign in or sign up before continuing.
提交 cc702670 编写于 作者: I Ido Schimmel 提交者: David S. Miller

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: NIdo Schimmel <idosch@mellanox.com>
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4db93fb8
...@@ -505,15 +505,15 @@ static int mlxsw_sp_lpm_tree_alloc(struct mlxsw_sp *mlxsw_sp, ...@@ -505,15 +505,15 @@ static int mlxsw_sp_lpm_tree_alloc(struct mlxsw_sp *mlxsw_sp,
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralta), ralta_pl); return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralta), ralta_pl);
} }
static int mlxsw_sp_lpm_tree_free(struct mlxsw_sp *mlxsw_sp, static void mlxsw_sp_lpm_tree_free(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_lpm_tree *lpm_tree) struct mlxsw_sp_lpm_tree *lpm_tree)
{ {
char ralta_pl[MLXSW_REG_RALTA_LEN]; char ralta_pl[MLXSW_REG_RALTA_LEN];
mlxsw_reg_ralta_pack(ralta_pl, false, mlxsw_reg_ralta_pack(ralta_pl, false,
(enum mlxsw_reg_ralxx_protocol) lpm_tree->proto, (enum mlxsw_reg_ralxx_protocol) lpm_tree->proto,
lpm_tree->id); lpm_tree->id);
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralta), ralta_pl); mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ralta), ralta_pl);
} }
static int static int
...@@ -569,10 +569,10 @@ mlxsw_sp_lpm_tree_create(struct mlxsw_sp *mlxsw_sp, ...@@ -569,10 +569,10 @@ mlxsw_sp_lpm_tree_create(struct mlxsw_sp *mlxsw_sp,
return ERR_PTR(err); return ERR_PTR(err);
} }
static int mlxsw_sp_lpm_tree_destroy(struct mlxsw_sp *mlxsw_sp, static void mlxsw_sp_lpm_tree_destroy(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_lpm_tree *lpm_tree) struct mlxsw_sp_lpm_tree *lpm_tree)
{ {
return mlxsw_sp_lpm_tree_free(mlxsw_sp, lpm_tree); mlxsw_sp_lpm_tree_free(mlxsw_sp, lpm_tree);
} }
static struct mlxsw_sp_lpm_tree * static struct mlxsw_sp_lpm_tree *
...@@ -601,12 +601,11 @@ mlxsw_sp_lpm_tree_get(struct mlxsw_sp *mlxsw_sp, ...@@ -601,12 +601,11 @@ mlxsw_sp_lpm_tree_get(struct mlxsw_sp *mlxsw_sp,
return lpm_tree; return lpm_tree;
} }
static int mlxsw_sp_lpm_tree_put(struct mlxsw_sp *mlxsw_sp, static void mlxsw_sp_lpm_tree_put(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_lpm_tree *lpm_tree) struct mlxsw_sp_lpm_tree *lpm_tree)
{ {
if (--lpm_tree->ref_count == 0) if (--lpm_tree->ref_count == 0)
return mlxsw_sp_lpm_tree_destroy(mlxsw_sp, lpm_tree); mlxsw_sp_lpm_tree_destroy(mlxsw_sp, lpm_tree);
return 0;
} }
#define MLXSW_SP_LPM_TREE_MIN 1 /* tree 0 is reserved */ #define MLXSW_SP_LPM_TREE_MIN 1 /* tree 0 is reserved */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册