]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mlxsw: spectrum_acl: Move block helpers into inline header functions
authorJiri Pirko <jiri@mellanox.com>
Mon, 27 Apr 2020 15:12:58 +0000 (18:12 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Apr 2020 19:43:29 +0000 (12:43 -0700)
The struct is defined in the header, no need to have the helpers
in the c file. Move the helpers to the header.

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>
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c

index ca56e72cb4b736b06a1c2c688cd058ed5943d841..f158cd98f8d8d1b2b58b52975e62046c573986d9 100644 (file)
@@ -677,12 +677,57 @@ struct mlxsw_sp_acl_block {
 };
 
 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);
-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_dec(struct mlxsw_sp_acl_block *block);
-bool mlxsw_sp_acl_block_disabled(const struct mlxsw_sp_acl_block *block);
+
+static inline struct mlxsw_sp *
+mlxsw_sp_acl_block_mlxsw_sp(struct mlxsw_sp_acl_block *block)
+{
+       return block->mlxsw_sp;
+}
+
+static inline unsigned int
+mlxsw_sp_acl_block_rule_count(const struct mlxsw_sp_acl_block *block)
+{
+       return block ? block->rule_count : 0;
+}
+
+static inline void
+mlxsw_sp_acl_block_disable_inc(struct mlxsw_sp_acl_block *block)
+{
+       if (block)
+               block->disable_count++;
+}
+
+static inline void
+mlxsw_sp_acl_block_disable_dec(struct mlxsw_sp_acl_block *block)
+{
+       if (block)
+               block->disable_count--;
+}
+
+static inline bool
+mlxsw_sp_acl_block_disabled(const struct mlxsw_sp_acl_block *block)
+{
+       return block->disable_count;
+}
+
+static inline bool
+mlxsw_sp_acl_block_is_egress_bound(const struct mlxsw_sp_acl_block *block)
+{
+       return block->egress_binding_count;
+}
+
+static inline bool
+mlxsw_sp_acl_block_is_ingress_bound(const struct mlxsw_sp_acl_block *block)
+{
+       return block->ingress_binding_count;
+}
+
+static inline bool
+mlxsw_sp_acl_block_is_mixed_bound(const struct mlxsw_sp_acl_block *block)
+{
+       return block->ingress_binding_count && block->egress_binding_count;
+}
+
 struct mlxsw_sp_acl_block *mlxsw_sp_acl_block_create(struct mlxsw_sp *mlxsw_sp,
                                                     struct net *net);
 void mlxsw_sp_acl_block_destroy(struct mlxsw_sp_acl_block *block);
@@ -695,9 +740,6 @@ int mlxsw_sp_acl_block_unbind(struct mlxsw_sp *mlxsw_sp,
                              struct mlxsw_sp_acl_block *block,
                              struct mlxsw_sp_port *mlxsw_sp_port,
                              bool ingress);
-bool mlxsw_sp_acl_block_is_egress_bound(const struct mlxsw_sp_acl_block *block);
-bool mlxsw_sp_acl_block_is_ingress_bound(const struct mlxsw_sp_acl_block *block);
-bool mlxsw_sp_acl_block_is_mixed_bound(const struct mlxsw_sp_acl_block *block);
 struct mlxsw_sp_acl_ruleset *
 mlxsw_sp_acl_ruleset_lookup(struct mlxsw_sp *mlxsw_sp,
                            struct mlxsw_sp_acl_block *block, u32 chain_index,
index 01cff711bbd2e69ee401fe91736989f0f5823d8a..bb06c007b3f22dce014c7ad076230bea2bb7ebde 100644 (file)
@@ -94,49 +94,6 @@ struct mlxsw_sp_fid *mlxsw_sp_acl_dummy_fid(struct mlxsw_sp *mlxsw_sp)
        return mlxsw_sp->acl->dummy_fid;
 }
 
-struct mlxsw_sp *mlxsw_sp_acl_block_mlxsw_sp(struct mlxsw_sp_acl_block *block)
-{
-       return block->mlxsw_sp;
-}
-
-unsigned int
-mlxsw_sp_acl_block_rule_count(const struct mlxsw_sp_acl_block *block)
-{
-       return block ? block->rule_count : 0;
-}
-
-void mlxsw_sp_acl_block_disable_inc(struct mlxsw_sp_acl_block *block)
-{
-       if (block)
-               block->disable_count++;
-}
-
-void mlxsw_sp_acl_block_disable_dec(struct mlxsw_sp_acl_block *block)
-{
-       if (block)
-               block->disable_count--;
-}
-
-bool mlxsw_sp_acl_block_disabled(const struct mlxsw_sp_acl_block *block)
-{
-       return block->disable_count;
-}
-
-bool mlxsw_sp_acl_block_is_egress_bound(const struct mlxsw_sp_acl_block *block)
-{
-       return block->egress_binding_count;
-}
-
-bool mlxsw_sp_acl_block_is_ingress_bound(const struct mlxsw_sp_acl_block *block)
-{
-       return block->ingress_binding_count;
-}
-
-bool mlxsw_sp_acl_block_is_mixed_bound(const struct mlxsw_sp_acl_block *block)
-{
-       return block->ingress_binding_count && block->egress_binding_count;
-}
-
 static bool
 mlxsw_sp_acl_ruleset_is_singular(const struct mlxsw_sp_acl_ruleset *ruleset)
 {