diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2017-08-05 07:31:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-08 00:12:17 +0300 |
commit | 8113c095672f6504b23eba6edf4a57b5f7f744af (patch) | |
tree | 24712765682423e7901c41b033b3ce5b050d13bb /net/sched/cls_api.c | |
parent | 54df2cf819a23dba4bb2c4134ed62659a7d324f5 (diff) | |
download | linux-8113c095672f6504b23eba6edf4a57b5f7f744af.tar.xz |
net_sched: use void pointer for filter handle
Now we use 'unsigned long fh' as a pointer in every place,
it is safe to convert it to a void pointer now. This gets
rid of many casts to pointer.
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
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>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r-- | net/sched/cls_api.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index afd099727aea..668afb6e9885 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -102,11 +102,11 @@ EXPORT_SYMBOL(unregister_tcf_proto_ops); static int tfilter_notify(struct net *net, struct sk_buff *oskb, struct nlmsghdr *n, struct tcf_proto *tp, - unsigned long fh, int event, bool unicast); + void *fh, int event, bool unicast); static int tfilter_del_notify(struct net *net, struct sk_buff *oskb, struct nlmsghdr *n, struct tcf_proto *tp, - unsigned long fh, bool unicast, bool *last); + void *fh, bool unicast, bool *last); static void tfilter_notify_chain(struct net *net, struct sk_buff *oskb, struct nlmsghdr *n, @@ -432,7 +432,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, struct tcf_proto *tp; const struct Qdisc_class_ops *cops; unsigned long cl; - unsigned long fh; + void *fh; int err; int tp_created; @@ -571,7 +571,7 @@ replay: fh = tp->ops->get(tp, t->tcm_handle); - if (fh == 0) { + if (!fh) { if (n->nlmsg_type == RTM_DELTFILTER && t->tcm_handle == 0) { tcf_chain_tp_remove(chain, &chain_info, tp); tfilter_notify(net, skb, n, tp, fh, @@ -641,7 +641,7 @@ errout: } static int tcf_fill_node(struct net *net, struct sk_buff *skb, - struct tcf_proto *tp, unsigned long fh, u32 portid, + struct tcf_proto *tp, void *fh, u32 portid, u32 seq, u16 flags, int event) { struct tcmsg *tcm; @@ -679,7 +679,7 @@ nla_put_failure: static int tfilter_notify(struct net *net, struct sk_buff *oskb, struct nlmsghdr *n, struct tcf_proto *tp, - unsigned long fh, int event, bool unicast) + void *fh, int event, bool unicast) { struct sk_buff *skb; u32 portid = oskb ? NETLINK_CB(oskb).portid : 0; @@ -703,7 +703,7 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb, static int tfilter_del_notify(struct net *net, struct sk_buff *oskb, struct nlmsghdr *n, struct tcf_proto *tp, - unsigned long fh, bool unicast, bool *last) + void *fh, bool unicast, bool *last) { struct sk_buff *skb; u32 portid = oskb ? NETLINK_CB(oskb).portid : 0; @@ -738,8 +738,7 @@ struct tcf_dump_args { struct netlink_callback *cb; }; -static int tcf_node_dump(struct tcf_proto *tp, unsigned long n, - struct tcf_walker *arg) +static int tcf_node_dump(struct tcf_proto *tp, void *n, struct tcf_walker *arg) { struct tcf_dump_args *a = (void *)arg; struct net *net = sock_net(a->skb->sk); |