]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net_sched: make tcf_hash_check() boolean
authorWANG Cong <xiyou.wangcong@gmail.com>
Mon, 13 Jun 2016 20:46:28 +0000 (13:46 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jun 2016 19:43:35 +0000 (12:43 -0700)
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/act_api.h
net/sched/act_api.c
net/sched/act_ife.c
net/sched/act_ipt.c
net/sched/act_mirred.c
net/sched/act_simple.c
net/sched/act_skbedit.c
net/sched/act_vlan.c

index db218a12efb5427fcb72d05d42f013b6a5f536de..fb82b5b5d9e7923078ed012810fed70319fc2d99 100644 (file)
@@ -155,8 +155,8 @@ int tcf_generic_walker(struct tc_action_net *tn, struct sk_buff *skb,
                       struct tc_action *a);
 int tcf_hash_search(struct tc_action_net *tn, struct tc_action *a, u32 index);
 u32 tcf_hash_new_index(struct tc_action_net *tn);
-int tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
-                  int bind);
+bool tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
+                   int bind);
 int tcf_hash_create(struct tc_action_net *tn, u32 index, struct nlattr *est,
                    struct tc_action *a, int size, int bind, bool cpustats);
 void tcf_hash_cleanup(struct tc_action *a, struct nlattr *est);
index b6db56ec811703516870110d5c1f302980a6013e..f8c61d2a79635d4951858341f02bb456446886f6 100644 (file)
@@ -224,8 +224,8 @@ int tcf_hash_search(struct tc_action_net *tn, struct tc_action *a, u32 index)
 }
 EXPORT_SYMBOL(tcf_hash_search);
 
-int tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
-                  int bind)
+bool tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
+                   int bind)
 {
        struct tcf_hashinfo *hinfo = tn->hinfo;
        struct tcf_common *p = NULL;
@@ -235,9 +235,9 @@ int tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
                p->tcfc_refcnt++;
                a->priv = p;
                a->hinfo = hinfo;
-               return 1;
+               return true;
        }
-       return 0;
+       return false;
 }
 EXPORT_SYMBOL(tcf_hash_check);
 
index 02f5a8ba95d7a3bacc98d31a531bc8e2c64c36e5..b7fa96926c90447d49cb534262c43cd92f02041f 100644 (file)
@@ -423,7 +423,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
        u16 ife_type = 0;
        u8 *daddr = NULL;
        u8 *saddr = NULL;
-       int ret = 0, exists = 0;
+       bool exists = false;
+       int ret = 0;
        int err;
 
        err = nla_parse_nested(tb, TCA_IFE_MAX, nla, ife_policy);
index 8998a3594e86c9ec448d3c6d0dcea14f915b8810..6148e323ed93b8a0bc1c8c0c02157a748f44171e 100644 (file)
@@ -97,7 +97,8 @@ static int __tcf_ipt_init(struct tc_action_net *tn, struct nlattr *nla,
        struct tcf_ipt *ipt;
        struct xt_entry_target *td, *t;
        char *tname;
-       int ret = 0, err, exists = 0;
+       bool exists = false;
+       int ret = 0, err;
        u32 hook = 0;
        u32 index = 0;
 
index 787751a7981af7f2432e0e553a1992847bbc97af..5b135d357e1e56b64c287cb27a00f9a2e0a9783b 100644 (file)
@@ -62,7 +62,8 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
        struct tc_mirred *parm;
        struct tcf_mirred *m;
        struct net_device *dev;
-       int ret, ok_push = 0, exists = 0;
+       int ret, ok_push = 0;
+       bool exists = false;
 
        if (nla == NULL)
                return -EINVAL;
index be5fbb51cfeddad9e6215d4473d0c35b1df6fdf3..318328d34d12aa7784ffd0a2de7486b02df6f399 100644 (file)
@@ -86,8 +86,9 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
        struct nlattr *tb[TCA_DEF_MAX + 1];
        struct tc_defact *parm;
        struct tcf_defact *d;
+       bool exists = false;
+       int ret = 0, err;
        char *defdata;
-       int ret = 0, err, exists = 0;
 
        if (nla == NULL)
                return -EINVAL;
index 7e2bc3c2b6da07fa6f14617363889363dcb711ad..53d1486cddf74188e35d936beb7b0adca4784901 100644 (file)
@@ -69,7 +69,8 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
        struct tcf_skbedit *d;
        u32 flags = 0, *priority = NULL, *mark = NULL;
        u16 *queue_mapping = NULL;
-       int ret = 0, err, exists = 0;
+       bool exists = false;
+       int ret = 0, err;
 
        if (nla == NULL)
                return -EINVAL;
index b075d50e0fc322a815dffef9a6fbf9d1d4358271..db9b7ed570baa42d71c2a04257bcad19489110ff 100644 (file)
@@ -77,8 +77,8 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla,
        int action;
        __be16 push_vid = 0;
        __be16 push_proto = 0;
-       int ret = 0, exists = 0;
-       int err;
+       bool exists = false;
+       int ret = 0, err;
 
        if (!nla)
                return -EINVAL;