Skip to content

Commit b231307

Browse files
congwangdavem330
authored andcommitted
net_sched: make tcf_hash_check() boolean
Cc: Jamal Hadi Salim <[email protected]> Signed-off-by: Cong Wang <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a6e225c commit b231307

File tree

8 files changed

+18
-13
lines changed

8 files changed

+18
-13
lines changed

include/net/act_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ int tcf_generic_walker(struct tc_action_net *tn, struct sk_buff *skb,
155155
struct tc_action *a);
156156
int tcf_hash_search(struct tc_action_net *tn, struct tc_action *a, u32 index);
157157
u32 tcf_hash_new_index(struct tc_action_net *tn);
158-
int tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
159-
int bind);
158+
bool tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
159+
int bind);
160160
int tcf_hash_create(struct tc_action_net *tn, u32 index, struct nlattr *est,
161161
struct tc_action *a, int size, int bind, bool cpustats);
162162
void tcf_hash_cleanup(struct tc_action *a, struct nlattr *est);

net/sched/act_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ int tcf_hash_search(struct tc_action_net *tn, struct tc_action *a, u32 index)
224224
}
225225
EXPORT_SYMBOL(tcf_hash_search);
226226

227-
int tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
228-
int bind)
227+
bool tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
228+
int bind)
229229
{
230230
struct tcf_hashinfo *hinfo = tn->hinfo;
231231
struct tcf_common *p = NULL;
@@ -235,9 +235,9 @@ int tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action *a,
235235
p->tcfc_refcnt++;
236236
a->priv = p;
237237
a->hinfo = hinfo;
238-
return 1;
238+
return true;
239239
}
240-
return 0;
240+
return false;
241241
}
242242
EXPORT_SYMBOL(tcf_hash_check);
243243

net/sched/act_ife.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
423423
u16 ife_type = 0;
424424
u8 *daddr = NULL;
425425
u8 *saddr = NULL;
426-
int ret = 0, exists = 0;
426+
bool exists = false;
427+
int ret = 0;
427428
int err;
428429

429430
err = nla_parse_nested(tb, TCA_IFE_MAX, nla, ife_policy);

net/sched/act_ipt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ static int __tcf_ipt_init(struct tc_action_net *tn, struct nlattr *nla,
9797
struct tcf_ipt *ipt;
9898
struct xt_entry_target *td, *t;
9999
char *tname;
100-
int ret = 0, err, exists = 0;
100+
bool exists = false;
101+
int ret = 0, err;
101102
u32 hook = 0;
102103
u32 index = 0;
103104

net/sched/act_mirred.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
6262
struct tc_mirred *parm;
6363
struct tcf_mirred *m;
6464
struct net_device *dev;
65-
int ret, ok_push = 0, exists = 0;
65+
int ret, ok_push = 0;
66+
bool exists = false;
6667

6768
if (nla == NULL)
6869
return -EINVAL;

net/sched/act_simple.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
8686
struct nlattr *tb[TCA_DEF_MAX + 1];
8787
struct tc_defact *parm;
8888
struct tcf_defact *d;
89+
bool exists = false;
90+
int ret = 0, err;
8991
char *defdata;
90-
int ret = 0, err, exists = 0;
9192

9293
if (nla == NULL)
9394
return -EINVAL;

net/sched/act_skbedit.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
6969
struct tcf_skbedit *d;
7070
u32 flags = 0, *priority = NULL, *mark = NULL;
7171
u16 *queue_mapping = NULL;
72-
int ret = 0, err, exists = 0;
72+
bool exists = false;
73+
int ret = 0, err;
7374

7475
if (nla == NULL)
7576
return -EINVAL;

net/sched/act_vlan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla,
7777
int action;
7878
__be16 push_vid = 0;
7979
__be16 push_proto = 0;
80-
int ret = 0, exists = 0;
81-
int err;
80+
bool exists = false;
81+
int ret = 0, err;
8282

8383
if (!nla)
8484
return -EINVAL;

0 commit comments

Comments
 (0)