net: sched: remove redundant helpers tcf_exts_is_predicative and tcf_exts_is_available
authorJiri Pirko <jiri@mellanox.com>
Fri, 4 Aug 2017 12:29:00 +0000 (14:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Aug 2017 18:21:23 +0000 (11:21 -0700)
These two helpers are doing the same as tcf_exts_has_actions, so remove
them and use tcf_exts_has_actions instead.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/pkt_cls.h
net/sched/cls_fw.c
net/sched/cls_route.c
net/sched/cls_tcindex.c

index 322a2823cc6a3735bcbc8dacc9a0a1d7c9686303..817badf733b5d35bd1fa2bbb98233a4108610dfe 100644 (file)
@@ -113,36 +113,6 @@ static inline int tcf_exts_init(struct tcf_exts *exts, int action, int police)
        return 0;
 }
 
-/**
- * tcf_exts_is_predicative - check if a predicative extension is present
- * @exts: tc filter extensions handle
- *
- * Returns 1 if a predicative extension is present, i.e. an extension which
- * might cause further actions and thus overrule the regular tcf_result.
- */
-static inline int
-tcf_exts_is_predicative(struct tcf_exts *exts)
-{
-#ifdef CONFIG_NET_CLS_ACT
-       return exts->nr_actions;
-#else
-       return 0;
-#endif
-}
-
-/**
- * tcf_exts_is_available - check if at least one extension is present
- * @exts: tc filter extensions handle
- *
- * Returns 1 if at least one extension is present.
- */
-static inline int
-tcf_exts_is_available(struct tcf_exts *exts)
-{
-       /* All non-predicative extensions must be added here. */
-       return tcf_exts_is_predicative(exts);
-}
-
 static inline void tcf_exts_to_list(const struct tcf_exts *exts,
                                    struct list_head *actions)
 {
index d3885362e017e1b477c6c2e4d8abea4b1e021c53..a53fa75dfc7bc62edb7632db317d2f1599772448 100644 (file)
@@ -387,7 +387,7 @@ static int fw_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
 
        t->tcm_handle = f->id;
 
-       if (!f->res.classid && !tcf_exts_is_available(&f->exts))
+       if (!f->res.classid && !tcf_exts_has_actions(&f->exts))
                return skb->len;
 
        nest = nla_nest_start(skb, TCA_OPTIONS);
index d63d5502ee020350e72b818c5607000a21df915a..26f86363486250b796c2a9d38a9ae2f2ec5d37af 100644 (file)
@@ -113,7 +113,7 @@ static inline int route4_hash_wild(void)
 #define ROUTE4_APPLY_RESULT()                                  \
 {                                                              \
        *res = f->res;                                          \
-       if (tcf_exts_is_available(&f->exts)) {                  \
+       if (tcf_exts_has_actions(&f->exts)) {                   \
                int r = tcf_exts_exec(skb, &f->exts, res);      \
                if (r < 0) {                                    \
                        dont_cache = 1;                         \
index 8a8a58357c39b8e38c2d3740aaa93ed67866fe54..66924d147e97335b0bdce434bdf6216dd1a602f2 100644 (file)
@@ -52,7 +52,7 @@ struct tcindex_data {
 
 static inline int tcindex_filter_is_set(struct tcindex_filter_result *r)
 {
-       return tcf_exts_is_predicative(&r->exts) || r->res.classid;
+       return tcf_exts_has_actions(&r->exts) || r->res.classid;
 }
 
 static struct tcindex_filter_result *tcindex_lookup(struct tcindex_data *p,