Commit b2313077 authored by WANG Cong's avatar WANG Cong Committed by David S. Miller

net_sched: make tcf_hash_check() boolean

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a6e225ca
...@@ -155,7 +155,7 @@ int tcf_generic_walker(struct tc_action_net *tn, struct sk_buff *skb, ...@@ -155,7 +155,7 @@ int tcf_generic_walker(struct tc_action_net *tn, struct sk_buff *skb,
struct tc_action *a); struct tc_action *a);
int tcf_hash_search(struct tc_action_net *tn, struct tc_action *a, u32 index); 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); 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, bool tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
int bind); int bind);
int tcf_hash_create(struct tc_action_net *tn, u32 index, struct nlattr *est, int tcf_hash_create(struct tc_action_net *tn, u32 index, struct nlattr *est,
struct tc_action *a, int size, int bind, bool cpustats); struct tc_action *a, int size, int bind, bool cpustats);
......
...@@ -224,7 +224,7 @@ int tcf_hash_search(struct tc_action_net *tn, struct tc_action *a, u32 index) ...@@ -224,7 +224,7 @@ int tcf_hash_search(struct tc_action_net *tn, struct tc_action *a, u32 index)
} }
EXPORT_SYMBOL(tcf_hash_search); EXPORT_SYMBOL(tcf_hash_search);
int tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a, bool tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
int bind) int bind)
{ {
struct tcf_hashinfo *hinfo = tn->hinfo; struct tcf_hashinfo *hinfo = tn->hinfo;
...@@ -235,9 +235,9 @@ int tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a, ...@@ -235,9 +235,9 @@ int tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
p->tcfc_refcnt++; p->tcfc_refcnt++;
a->priv = p; a->priv = p;
a->hinfo = hinfo; a->hinfo = hinfo;
return 1; return true;
} }
return 0; return false;
} }
EXPORT_SYMBOL(tcf_hash_check); EXPORT_SYMBOL(tcf_hash_check);
......
...@@ -423,7 +423,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, ...@@ -423,7 +423,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
u16 ife_type = 0; u16 ife_type = 0;
u8 *daddr = NULL; u8 *daddr = NULL;
u8 *saddr = NULL; u8 *saddr = NULL;
int ret = 0, exists = 0; bool exists = false;
int ret = 0;
int err; int err;
err = nla_parse_nested(tb, TCA_IFE_MAX, nla, ife_policy); err = nla_parse_nested(tb, TCA_IFE_MAX, nla, ife_policy);
......
...@@ -97,7 +97,8 @@ static int __tcf_ipt_init(struct tc_action_net *tn, struct nlattr *nla, ...@@ -97,7 +97,8 @@ static int __tcf_ipt_init(struct tc_action_net *tn, struct nlattr *nla,
struct tcf_ipt *ipt; struct tcf_ipt *ipt;
struct xt_entry_target *td, *t; struct xt_entry_target *td, *t;
char *tname; char *tname;
int ret = 0, err, exists = 0; bool exists = false;
int ret = 0, err;
u32 hook = 0; u32 hook = 0;
u32 index = 0; u32 index = 0;
......
...@@ -62,7 +62,8 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla, ...@@ -62,7 +62,8 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
struct tc_mirred *parm; struct tc_mirred *parm;
struct tcf_mirred *m; struct tcf_mirred *m;
struct net_device *dev; struct net_device *dev;
int ret, ok_push = 0, exists = 0; int ret, ok_push = 0;
bool exists = false;
if (nla == NULL) if (nla == NULL)
return -EINVAL; return -EINVAL;
......
...@@ -86,8 +86,9 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla, ...@@ -86,8 +86,9 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
struct nlattr *tb[TCA_DEF_MAX + 1]; struct nlattr *tb[TCA_DEF_MAX + 1];
struct tc_defact *parm; struct tc_defact *parm;
struct tcf_defact *d; struct tcf_defact *d;
bool exists = false;
int ret = 0, err;
char *defdata; char *defdata;
int ret = 0, err, exists = 0;
if (nla == NULL) if (nla == NULL)
return -EINVAL; return -EINVAL;
......
...@@ -69,7 +69,8 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla, ...@@ -69,7 +69,8 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
struct tcf_skbedit *d; struct tcf_skbedit *d;
u32 flags = 0, *priority = NULL, *mark = NULL; u32 flags = 0, *priority = NULL, *mark = NULL;
u16 *queue_mapping = NULL; u16 *queue_mapping = NULL;
int ret = 0, err, exists = 0; bool exists = false;
int ret = 0, err;
if (nla == NULL) if (nla == NULL)
return -EINVAL; return -EINVAL;
......
...@@ -77,8 +77,8 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla, ...@@ -77,8 +77,8 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla,
int action; int action;
__be16 push_vid = 0; __be16 push_vid = 0;
__be16 push_proto = 0; __be16 push_proto = 0;
int ret = 0, exists = 0; bool exists = false;
int err; int ret = 0, err;
if (!nla) if (!nla)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment