mlxsw: spectrum_acl: Make block arg const where appropriate
There are couple of places where block pointer as a function argument can be const. So make those const. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
16adc56c45
commit
b32bd7f73a
@@ -670,10 +670,11 @@ struct mlxsw_sp_acl_block {
|
|||||||
|
|
||||||
struct mlxsw_afk *mlxsw_sp_acl_afk(struct mlxsw_sp_acl *acl);
|
struct mlxsw_afk *mlxsw_sp_acl_afk(struct mlxsw_sp_acl *acl);
|
||||||
struct mlxsw_sp *mlxsw_sp_acl_block_mlxsw_sp(struct mlxsw_sp_acl_block *block);
|
struct mlxsw_sp *mlxsw_sp_acl_block_mlxsw_sp(struct mlxsw_sp_acl_block *block);
|
||||||
unsigned int mlxsw_sp_acl_block_rule_count(struct mlxsw_sp_acl_block *block);
|
unsigned int
|
||||||
|
mlxsw_sp_acl_block_rule_count(const struct mlxsw_sp_acl_block *block);
|
||||||
void mlxsw_sp_acl_block_disable_inc(struct mlxsw_sp_acl_block *block);
|
void mlxsw_sp_acl_block_disable_inc(struct mlxsw_sp_acl_block *block);
|
||||||
void mlxsw_sp_acl_block_disable_dec(struct mlxsw_sp_acl_block *block);
|
void mlxsw_sp_acl_block_disable_dec(struct mlxsw_sp_acl_block *block);
|
||||||
bool mlxsw_sp_acl_block_disabled(struct mlxsw_sp_acl_block *block);
|
bool mlxsw_sp_acl_block_disabled(const struct mlxsw_sp_acl_block *block);
|
||||||
struct mlxsw_sp_acl_block *mlxsw_sp_acl_block_create(struct mlxsw_sp *mlxsw_sp,
|
struct mlxsw_sp_acl_block *mlxsw_sp_acl_block_create(struct mlxsw_sp *mlxsw_sp,
|
||||||
struct net *net);
|
struct net *net);
|
||||||
void mlxsw_sp_acl_block_destroy(struct mlxsw_sp_acl_block *block);
|
void mlxsw_sp_acl_block_destroy(struct mlxsw_sp_acl_block *block);
|
||||||
@@ -686,7 +687,7 @@ int mlxsw_sp_acl_block_unbind(struct mlxsw_sp *mlxsw_sp,
|
|||||||
struct mlxsw_sp_acl_block *block,
|
struct mlxsw_sp_acl_block *block,
|
||||||
struct mlxsw_sp_port *mlxsw_sp_port,
|
struct mlxsw_sp_port *mlxsw_sp_port,
|
||||||
bool ingress);
|
bool ingress);
|
||||||
bool mlxsw_sp_acl_block_is_egress_bound(struct mlxsw_sp_acl_block *block);
|
bool mlxsw_sp_acl_block_is_egress_bound(const struct mlxsw_sp_acl_block *block);
|
||||||
struct mlxsw_sp_acl_ruleset *
|
struct mlxsw_sp_acl_ruleset *
|
||||||
mlxsw_sp_acl_ruleset_lookup(struct mlxsw_sp *mlxsw_sp,
|
mlxsw_sp_acl_ruleset_lookup(struct mlxsw_sp *mlxsw_sp,
|
||||||
struct mlxsw_sp_acl_block *block, u32 chain_index,
|
struct mlxsw_sp_acl_block *block, u32 chain_index,
|
||||||
|
@@ -99,7 +99,8 @@ struct mlxsw_sp *mlxsw_sp_acl_block_mlxsw_sp(struct mlxsw_sp_acl_block *block)
|
|||||||
return block->mlxsw_sp;
|
return block->mlxsw_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int mlxsw_sp_acl_block_rule_count(struct mlxsw_sp_acl_block *block)
|
unsigned int
|
||||||
|
mlxsw_sp_acl_block_rule_count(const struct mlxsw_sp_acl_block *block)
|
||||||
{
|
{
|
||||||
return block ? block->rule_count : 0;
|
return block ? block->rule_count : 0;
|
||||||
}
|
}
|
||||||
@@ -116,12 +117,12 @@ void mlxsw_sp_acl_block_disable_dec(struct mlxsw_sp_acl_block *block)
|
|||||||
block->disable_count--;
|
block->disable_count--;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mlxsw_sp_acl_block_disabled(struct mlxsw_sp_acl_block *block)
|
bool mlxsw_sp_acl_block_disabled(const struct mlxsw_sp_acl_block *block)
|
||||||
{
|
{
|
||||||
return block->disable_count;
|
return block->disable_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mlxsw_sp_acl_block_is_egress_bound(struct mlxsw_sp_acl_block *block)
|
bool mlxsw_sp_acl_block_is_egress_bound(const struct mlxsw_sp_acl_block *block)
|
||||||
{
|
{
|
||||||
struct mlxsw_sp_acl_block_binding *binding;
|
struct mlxsw_sp_acl_block_binding *binding;
|
||||||
|
|
||||||
@@ -163,7 +164,8 @@ mlxsw_sp_acl_ruleset_unbind(struct mlxsw_sp *mlxsw_sp,
|
|||||||
binding->mlxsw_sp_port, binding->ingress);
|
binding->mlxsw_sp_port, binding->ingress);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool mlxsw_sp_acl_ruleset_block_bound(struct mlxsw_sp_acl_block *block)
|
static bool
|
||||||
|
mlxsw_sp_acl_ruleset_block_bound(const struct mlxsw_sp_acl_block *block)
|
||||||
{
|
{
|
||||||
return block->ruleset_zero;
|
return block->ruleset_zero;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user