Skip to content

Commit 5a7a555

Browse files
jhsmtdavem330
authored andcommitted
net sched: stylistic cleanups
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f71b109 commit 5a7a555

File tree

14 files changed

+114
-104
lines changed

14 files changed

+114
-104
lines changed

net/sched/act_api.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,8 @@ struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
592592
return ERR_PTR(err);
593593
}
594594

595-
int tcf_action_init(struct net *net, struct nlattr *nla,
596-
struct nlattr *est, char *name, int ovr,
597-
int bind, struct list_head *actions)
595+
int tcf_action_init(struct net *net, struct nlattr *nla, struct nlattr *est,
596+
char *name, int ovr, int bind, struct list_head *actions)
598597
{
599598
struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
600599
struct tc_action *act;
@@ -923,9 +922,8 @@ tcf_add_notify(struct net *net, struct nlmsghdr *n, struct list_head *actions,
923922
return err;
924923
}
925924

926-
static int
927-
tcf_action_add(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
928-
u32 portid, int ovr)
925+
static int tcf_action_add(struct net *net, struct nlattr *nla,
926+
struct nlmsghdr *n, u32 portid, int ovr)
929927
{
930928
int ret = 0;
931929
LIST_HEAD(actions);
@@ -988,8 +986,7 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n)
988986
return ret;
989987
}
990988

991-
static struct nlattr *
992-
find_dump_kind(const struct nlmsghdr *n)
989+
static struct nlattr *find_dump_kind(const struct nlmsghdr *n)
993990
{
994991
struct nlattr *tb1, *tb2[TCA_ACT_MAX + 1];
995992
struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
@@ -1016,8 +1013,7 @@ find_dump_kind(const struct nlmsghdr *n)
10161013
return kind;
10171014
}
10181015

1019-
static int
1020-
tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
1016+
static int tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
10211017
{
10221018
struct net *net = sock_net(skb->sk);
10231019
struct nlmsghdr *nlh;

net/sched/act_csum.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ static void *tcf_csum_skb_nextlayer(struct sk_buff *skb,
116116
return (void *)(skb_network_header(skb) + ihl);
117117
}
118118

119-
static int tcf_csum_ipv4_icmp(struct sk_buff *skb,
120-
unsigned int ihl, unsigned int ipl)
119+
static int tcf_csum_ipv4_icmp(struct sk_buff *skb, unsigned int ihl,
120+
unsigned int ipl)
121121
{
122122
struct icmphdr *icmph;
123123

@@ -152,8 +152,8 @@ static int tcf_csum_ipv4_igmp(struct sk_buff *skb,
152152
return 1;
153153
}
154154

155-
static int tcf_csum_ipv6_icmp(struct sk_buff *skb,
156-
unsigned int ihl, unsigned int ipl)
155+
static int tcf_csum_ipv6_icmp(struct sk_buff *skb, unsigned int ihl,
156+
unsigned int ipl)
157157
{
158158
struct icmp6hdr *icmp6h;
159159
const struct ipv6hdr *ip6h;
@@ -174,8 +174,8 @@ static int tcf_csum_ipv6_icmp(struct sk_buff *skb,
174174
return 1;
175175
}
176176

177-
static int tcf_csum_ipv4_tcp(struct sk_buff *skb,
178-
unsigned int ihl, unsigned int ipl)
177+
static int tcf_csum_ipv4_tcp(struct sk_buff *skb, unsigned int ihl,
178+
unsigned int ipl)
179179
{
180180
struct tcphdr *tcph;
181181
const struct iphdr *iph;
@@ -195,8 +195,8 @@ static int tcf_csum_ipv4_tcp(struct sk_buff *skb,
195195
return 1;
196196
}
197197

198-
static int tcf_csum_ipv6_tcp(struct sk_buff *skb,
199-
unsigned int ihl, unsigned int ipl)
198+
static int tcf_csum_ipv6_tcp(struct sk_buff *skb, unsigned int ihl,
199+
unsigned int ipl)
200200
{
201201
struct tcphdr *tcph;
202202
const struct ipv6hdr *ip6h;
@@ -217,8 +217,8 @@ static int tcf_csum_ipv6_tcp(struct sk_buff *skb,
217217
return 1;
218218
}
219219

220-
static int tcf_csum_ipv4_udp(struct sk_buff *skb,
221-
unsigned int ihl, unsigned int ipl, int udplite)
220+
static int tcf_csum_ipv4_udp(struct sk_buff *skb, unsigned int ihl,
221+
unsigned int ipl, int udplite)
222222
{
223223
struct udphdr *udph;
224224
const struct iphdr *iph;
@@ -270,8 +270,8 @@ static int tcf_csum_ipv4_udp(struct sk_buff *skb,
270270
return 1;
271271
}
272272

273-
static int tcf_csum_ipv6_udp(struct sk_buff *skb,
274-
unsigned int ihl, unsigned int ipl, int udplite)
273+
static int tcf_csum_ipv6_udp(struct sk_buff *skb, unsigned int ihl,
274+
unsigned int ipl, int udplite)
275275
{
276276
struct udphdr *udph;
277277
const struct ipv6hdr *ip6h;
@@ -380,8 +380,8 @@ static int tcf_csum_ipv4(struct sk_buff *skb, u32 update_flags)
380380
return 0;
381381
}
382382

383-
static int tcf_csum_ipv6_hopopts(struct ipv6_opt_hdr *ip6xh,
384-
unsigned int ixhl, unsigned int *pl)
383+
static int tcf_csum_ipv6_hopopts(struct ipv6_opt_hdr *ip6xh, unsigned int ixhl,
384+
unsigned int *pl)
385385
{
386386
int off, len, optlen;
387387
unsigned char *xh = (void *)ip6xh;
@@ -494,8 +494,8 @@ static int tcf_csum_ipv6(struct sk_buff *skb, u32 update_flags)
494494
return 0;
495495
}
496496

497-
static int tcf_csum(struct sk_buff *skb,
498-
const struct tc_action *a, struct tcf_result *res)
497+
static int tcf_csum(struct sk_buff *skb, const struct tc_action *a,
498+
struct tcf_result *res)
499499
{
500500
struct tcf_csum *p = to_tcf_csum(a);
501501
int action;
@@ -531,8 +531,8 @@ static int tcf_csum(struct sk_buff *skb,
531531
return TC_ACT_SHOT;
532532
}
533533

534-
static int tcf_csum_dump(struct sk_buff *skb,
535-
struct tc_action *a, int bind, int ref)
534+
static int tcf_csum_dump(struct sk_buff *skb, struct tc_action *a, int bind,
535+
int ref)
536536
{
537537
unsigned char *b = skb_tail_pointer(skb);
538538
struct tcf_csum *p = to_tcf_csum(a);

net/sched/act_gact.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ static void tcf_gact_stats_update(struct tc_action *a, u64 bytes, u32 packets,
156156
int action = READ_ONCE(gact->tcf_action);
157157
struct tcf_t *tm = &gact->tcf_tm;
158158

159-
_bstats_cpu_update(this_cpu_ptr(gact->common.cpu_bstats), bytes, packets);
159+
_bstats_cpu_update(this_cpu_ptr(gact->common.cpu_bstats), bytes,
160+
packets);
160161
if (action == TC_ACT_SHOT)
161162
this_cpu_ptr(gact->common.cpu_qstats)->drops += packets;
162163

net/sched/act_mirred.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
204204
return retval;
205205
}
206206

207-
static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
207+
static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind,
208+
int ref)
208209
{
209210
unsigned char *b = skb_tail_pointer(skb);
210211
struct tcf_mirred *m = to_mirred(a);

net/sched/act_police.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ static int tcf_act_police(struct sk_buff *skb, const struct tc_action *a,
263263
return police->tcf_action;
264264
}
265265

266-
static int
267-
tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
266+
static int tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a,
267+
int bind, int ref)
268268
{
269269
unsigned char *b = skb_tail_pointer(skb);
270270
struct tcf_police *police = to_police(a);
@@ -349,14 +349,12 @@ static struct pernet_operations police_net_ops = {
349349
.size = sizeof(struct tc_action_net),
350350
};
351351

352-
static int __init
353-
police_init_module(void)
352+
static int __init police_init_module(void)
354353
{
355354
return tcf_register_action(&act_police_ops, &police_net_ops);
356355
}
357356

358-
static void __exit
359-
police_cleanup_module(void)
357+
static void __exit police_cleanup_module(void)
360358
{
361359
tcf_unregister_action(&act_police_ops, &police_net_ops);
362360
}

net/sched/cls_api.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,15 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n)
344344
if (err == 0) {
345345
struct tcf_proto *next = rtnl_dereference(tp->next);
346346

347-
tfilter_notify(net, skb, n, tp, fh, RTM_DELTFILTER);
347+
tfilter_notify(net, skb, n, tp, fh,
348+
RTM_DELTFILTER);
348349
if (tcf_destroy(tp, false))
349350
RCU_INIT_POINTER(*back, next);
350351
}
351352
goto errout;
352353
case RTM_GETTFILTER:
353-
err = tfilter_notify(net, skb, n, tp, fh, RTM_NEWTFILTER);
354+
err = tfilter_notify(net, skb, n, tp, fh,
355+
RTM_NEWTFILTER);
354356
goto errout;
355357
default:
356358
err = -EINVAL;
@@ -448,7 +450,8 @@ static int tcf_node_dump(struct tcf_proto *tp, unsigned long n,
448450
struct net *net = sock_net(a->skb->sk);
449451

450452
return tcf_fill_node(net, a->skb, tp, n, NETLINK_CB(a->cb->skb).portid,
451-
a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTFILTER);
453+
a->cb->nlh->nlmsg_seq, NLM_F_MULTI,
454+
RTM_NEWTFILTER);
452455
}
453456

454457
/* called with RTNL */
@@ -552,16 +555,15 @@ void tcf_exts_destroy(struct tcf_exts *exts)
552555
EXPORT_SYMBOL(tcf_exts_destroy);
553556

554557
int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
555-
struct nlattr *rate_tlv, struct tcf_exts *exts, bool ovr)
558+
struct nlattr *rate_tlv, struct tcf_exts *exts, bool ovr)
556559
{
557560
#ifdef CONFIG_NET_CLS_ACT
558561
{
559562
struct tc_action *act;
560563

561564
if (exts->police && tb[exts->police]) {
562565
act = tcf_action_init_1(net, tb[exts->police], rate_tlv,
563-
"police", ovr,
564-
TCA_ACT_BIND);
566+
"police", ovr, TCA_ACT_BIND);
565567
if (IS_ERR(act))
566568
return PTR_ERR(act);
567569

@@ -573,8 +575,8 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
573575
int err, i = 0;
574576

575577
err = tcf_action_init(net, tb[exts->action], rate_tlv,
576-
NULL, ovr,
577-
TCA_ACT_BIND, &actions);
578+
NULL, ovr, TCA_ACT_BIND,
579+
&actions);
578580
if (err)
579581
return err;
580582
list_for_each_entry(act, &actions, list)

net/sched/cls_bpf.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ static const struct nla_policy bpf_policy[TCA_BPF_MAX + 1] = {
5555
[TCA_BPF_CLASSID] = { .type = NLA_U32 },
5656
[TCA_BPF_FLAGS] = { .type = NLA_U32 },
5757
[TCA_BPF_FD] = { .type = NLA_U32 },
58-
[TCA_BPF_NAME] = { .type = NLA_NUL_STRING, .len = CLS_BPF_NAME_LEN },
58+
[TCA_BPF_NAME] = { .type = NLA_NUL_STRING,
59+
.len = CLS_BPF_NAME_LEN },
5960
[TCA_BPF_OPS_LEN] = { .type = NLA_U16 },
6061
[TCA_BPF_OPS] = { .type = NLA_BINARY,
6162
.len = sizeof(struct sock_filter) * BPF_MAXINSNS },
@@ -409,7 +410,8 @@ static int cls_bpf_change(struct net *net, struct sk_buff *in_skb,
409410
goto errout;
410411
}
411412

412-
ret = cls_bpf_modify_existing(net, tp, prog, base, tb, tca[TCA_RATE], ovr);
413+
ret = cls_bpf_modify_existing(net, tp, prog, base, tb, tca[TCA_RATE],
414+
ovr);
413415
if (ret < 0)
414416
goto errout;
415417

net/sched/cls_flow.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,23 @@ static u32 flow_get_dst(const struct sk_buff *skb, const struct flow_keys *flow)
8787
return addr_fold(skb_dst(skb)) ^ (__force u16) tc_skb_protocol(skb);
8888
}
8989

90-
static u32 flow_get_proto(const struct sk_buff *skb, const struct flow_keys *flow)
90+
static u32 flow_get_proto(const struct sk_buff *skb,
91+
const struct flow_keys *flow)
9192
{
9293
return flow->basic.ip_proto;
9394
}
9495

95-
static u32 flow_get_proto_src(const struct sk_buff *skb, const struct flow_keys *flow)
96+
static u32 flow_get_proto_src(const struct sk_buff *skb,
97+
const struct flow_keys *flow)
9698
{
9799
if (flow->ports.ports)
98100
return ntohs(flow->ports.src);
99101

100102
return addr_fold(skb->sk);
101103
}
102104

103-
static u32 flow_get_proto_dst(const struct sk_buff *skb, const struct flow_keys *flow)
105+
static u32 flow_get_proto_dst(const struct sk_buff *skb,
106+
const struct flow_keys *flow)
104107
{
105108
if (flow->ports.ports)
106109
return ntohs(flow->ports.dst);
@@ -149,7 +152,8 @@ static u32 flow_get_nfct(const struct sk_buff *skb)
149152
})
150153
#endif
151154

152-
static u32 flow_get_nfct_src(const struct sk_buff *skb, const struct flow_keys *flow)
155+
static u32 flow_get_nfct_src(const struct sk_buff *skb,
156+
const struct flow_keys *flow)
153157
{
154158
switch (tc_skb_protocol(skb)) {
155159
case htons(ETH_P_IP):
@@ -161,7 +165,8 @@ static u32 flow_get_nfct_src(const struct sk_buff *skb, const struct flow_keys *
161165
return flow_get_src(skb, flow);
162166
}
163167

164-
static u32 flow_get_nfct_dst(const struct sk_buff *skb, const struct flow_keys *flow)
168+
static u32 flow_get_nfct_dst(const struct sk_buff *skb,
169+
const struct flow_keys *flow)
165170
{
166171
switch (tc_skb_protocol(skb)) {
167172
case htons(ETH_P_IP):
@@ -173,14 +178,16 @@ static u32 flow_get_nfct_dst(const struct sk_buff *skb, const struct flow_keys *
173178
return flow_get_dst(skb, flow);
174179
}
175180

176-
static u32 flow_get_nfct_proto_src(const struct sk_buff *skb, const struct flow_keys *flow)
181+
static u32 flow_get_nfct_proto_src(const struct sk_buff *skb,
182+
const struct flow_keys *flow)
177183
{
178184
return ntohs(CTTUPLE(skb, src.u.all));
179185
fallback:
180186
return flow_get_proto_src(skb, flow);
181187
}
182188

183-
static u32 flow_get_nfct_proto_dst(const struct sk_buff *skb, const struct flow_keys *flow)
189+
static u32 flow_get_nfct_proto_dst(const struct sk_buff *skb,
190+
const struct flow_keys *flow)
184191
{
185192
return ntohs(CTTUPLE(skb, dst.u.all));
186193
fallback:

net/sched/cls_flower.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
241241
tc.type = TC_SETUP_CLSFLOWER;
242242
tc.cls_flower = &offload;
243243

244-
err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol, &tc);
244+
err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol,
245+
&tc);
245246

246247
if (tc_skip_sw(flags))
247248
return err;

net/sched/cls_fw.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static u32 fw_hash(u32 handle)
5757
}
5858

5959
static int fw_classify(struct sk_buff *skb, const struct tcf_proto *tp,
60-
struct tcf_result *res)
60+
struct tcf_result *res)
6161
{
6262
struct fw_head *head = rcu_dereference_bh(tp->root);
6363
struct fw_filter *f;
@@ -188,7 +188,8 @@ static const struct nla_policy fw_policy[TCA_FW_MAX + 1] = {
188188

189189
static int
190190
fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f,
191-
struct nlattr **tb, struct nlattr **tca, unsigned long base, bool ovr)
191+
struct nlattr **tb, struct nlattr **tca, unsigned long base,
192+
bool ovr)
192193
{
193194
struct fw_head *head = rtnl_dereference(tp->root);
194195
struct tcf_exts e;
@@ -237,9 +238,8 @@ fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f,
237238

238239
static int fw_change(struct net *net, struct sk_buff *in_skb,
239240
struct tcf_proto *tp, unsigned long base,
240-
u32 handle,
241-
struct nlattr **tca,
242-
unsigned long *arg, bool ovr)
241+
u32 handle, struct nlattr **tca, unsigned long *arg,
242+
bool ovr)
243243
{
244244
struct fw_head *head = rtnl_dereference(tp->root);
245245
struct fw_filter *f = (struct fw_filter *) *arg;

net/sched/cls_route.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ static int route4_init(struct tcf_proto *tp)
268268
return 0;
269269
}
270270

271-
static void
272-
route4_delete_filter(struct rcu_head *head)
271+
static void route4_delete_filter(struct rcu_head *head)
273272
{
274273
struct route4_filter *f = container_of(head, struct route4_filter, rcu);
275274

@@ -474,10 +473,8 @@ static int route4_set_parms(struct net *net, struct tcf_proto *tp,
474473
}
475474

476475
static int route4_change(struct net *net, struct sk_buff *in_skb,
477-
struct tcf_proto *tp, unsigned long base,
478-
u32 handle,
479-
struct nlattr **tca,
480-
unsigned long *arg, bool ovr)
476+
struct tcf_proto *tp, unsigned long base, u32 handle,
477+
struct nlattr **tca, unsigned long *arg, bool ovr)
481478
{
482479
struct route4_head *head = rtnl_dereference(tp->root);
483480
struct route4_filter __rcu **fp;

0 commit comments

Comments
 (0)