]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/sched: act_api: unexport tcf_action_dump_1()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 17 Oct 2024 16:19:34 +0000 (19:19 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Wed, 23 Oct 2024 09:43:47 +0000 (11:43 +0200)
This isn't used outside act_api.c, but is called by tcf_dump_walker()
prior to its definition. So move it upwards and make it static.

Simultaneously, reorder the variable declarations so that they follow
the networking "reverse Christmas tree" coding style.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://patch.msgid.link/20241017161934.3599046-1-vladimir.oltean@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/act_api.h
net/sched/act_api.c

index 77ee0c657e2c78276ecb2efca7f4c3d28be511a2..404df8557f6a13420b18d9c52b9710fe86d084aa 100644 (file)
@@ -219,7 +219,6 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
 int tcf_action_dump(struct sk_buff *skb, struct tc_action *actions[], int bind,
                    int ref, bool terse);
 int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
-int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
 
 static inline void tcf_action_update_bstats(struct tc_action *a,
                                            struct sk_buff *skb)
index 5bbfb83ed600af71cdf8e4775aee25f7a7274c6b..c3f8dd7f8e65b19c1228c7410129e8d744489a88 100644 (file)
@@ -504,6 +504,50 @@ nla_put_failure:
        return -1;
 }
 
+static int
+tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
+{
+       unsigned char *b = skb_tail_pointer(skb);
+       struct nlattr *nest;
+       int err = -EINVAL;
+       u32 flags;
+
+       if (tcf_action_dump_terse(skb, a, false))
+               goto nla_put_failure;
+
+       if (a->hw_stats != TCA_ACT_HW_STATS_ANY &&
+           nla_put_bitfield32(skb, TCA_ACT_HW_STATS,
+                              a->hw_stats, TCA_ACT_HW_STATS_ANY))
+               goto nla_put_failure;
+
+       if (a->used_hw_stats_valid &&
+           nla_put_bitfield32(skb, TCA_ACT_USED_HW_STATS,
+                              a->used_hw_stats, TCA_ACT_HW_STATS_ANY))
+               goto nla_put_failure;
+
+       flags = a->tcfa_flags & TCA_ACT_FLAGS_USER_MASK;
+       if (flags &&
+           nla_put_bitfield32(skb, TCA_ACT_FLAGS,
+                              flags, flags))
+               goto nla_put_failure;
+
+       if (nla_put_u32(skb, TCA_ACT_IN_HW_COUNT, a->in_hw_count))
+               goto nla_put_failure;
+
+       nest = nla_nest_start_noflag(skb, TCA_ACT_OPTIONS);
+       if (nest == NULL)
+               goto nla_put_failure;
+       err = tcf_action_dump_old(skb, a, bind, ref);
+       if (err > 0) {
+               nla_nest_end(skb, nest);
+               return err;
+       }
+
+nla_put_failure:
+       nlmsg_trim(skb, b);
+       return -1;
+}
+
 static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
                           struct netlink_callback *cb)
 {
@@ -1190,51 +1234,6 @@ tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
        return a->ops->dump(skb, a, bind, ref);
 }
 
-int
-tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
-{
-       int err = -EINVAL;
-       unsigned char *b = skb_tail_pointer(skb);
-       struct nlattr *nest;
-       u32 flags;
-
-       if (tcf_action_dump_terse(skb, a, false))
-               goto nla_put_failure;
-
-       if (a->hw_stats != TCA_ACT_HW_STATS_ANY &&
-           nla_put_bitfield32(skb, TCA_ACT_HW_STATS,
-                              a->hw_stats, TCA_ACT_HW_STATS_ANY))
-               goto nla_put_failure;
-
-       if (a->used_hw_stats_valid &&
-           nla_put_bitfield32(skb, TCA_ACT_USED_HW_STATS,
-                              a->used_hw_stats, TCA_ACT_HW_STATS_ANY))
-               goto nla_put_failure;
-
-       flags = a->tcfa_flags & TCA_ACT_FLAGS_USER_MASK;
-       if (flags &&
-           nla_put_bitfield32(skb, TCA_ACT_FLAGS,
-                              flags, flags))
-               goto nla_put_failure;
-
-       if (nla_put_u32(skb, TCA_ACT_IN_HW_COUNT, a->in_hw_count))
-               goto nla_put_failure;
-
-       nest = nla_nest_start_noflag(skb, TCA_ACT_OPTIONS);
-       if (nest == NULL)
-               goto nla_put_failure;
-       err = tcf_action_dump_old(skb, a, bind, ref);
-       if (err > 0) {
-               nla_nest_end(skb, nest);
-               return err;
-       }
-
-nla_put_failure:
-       nlmsg_trim(skb, b);
-       return -1;
-}
-EXPORT_SYMBOL(tcf_action_dump_1);
-
 int tcf_action_dump(struct sk_buff *skb, struct tc_action *actions[],
                    int bind, int ref, bool terse)
 {