aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_teql.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-01-19 14:26:56 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-20 02:31:12 -0500
commitcc7ec456f82da7f89a5b376e613b3ac4311b3e9a (patch)
tree534729db08c10f40c090261cdc191dd2303dfc5c /net/sched/sch_teql.c
parent7180a03118cac7256fb04f929fe34d0aeee92c40 (diff)
net_sched: cleanups
Cleanup net/sched code to current CodingStyle and practices. Reduce inline abuse Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_teql.c')
-rw-r--r--net/sched/sch_teql.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
index 84ce48eadff4..64c071ded0f4 100644
--- a/net/sched/sch_teql.c
+++ b/net/sched/sch_teql.c
@@ -53,8 +53,7 @@
53 which will not break load balancing, though native slave 53 which will not break load balancing, though native slave
54 traffic will have the highest priority. */ 54 traffic will have the highest priority. */
55 55
56struct teql_master 56struct teql_master {
57{
58 struct Qdisc_ops qops; 57 struct Qdisc_ops qops;
59 struct net_device *dev; 58 struct net_device *dev;
60 struct Qdisc *slaves; 59 struct Qdisc *slaves;
@@ -65,22 +64,21 @@ struct teql_master
65 unsigned long tx_dropped; 64 unsigned long tx_dropped;
66}; 65};
67 66
68struct teql_sched_data 67struct teql_sched_data {
69{
70 struct Qdisc *next; 68 struct Qdisc *next;
71 struct teql_master *m; 69 struct teql_master *m;
72 struct neighbour *ncache; 70 struct neighbour *ncache;
73 struct sk_buff_head q; 71 struct sk_buff_head q;
74}; 72};
75 73
76#define NEXT_SLAVE(q) (((struct teql_sched_data*)qdisc_priv(q))->next) 74#define NEXT_SLAVE(q) (((struct teql_sched_data *)qdisc_priv(q))->next)
77 75
78#define FMASK (IFF_BROADCAST|IFF_POINTOPOINT) 76#define FMASK (IFF_BROADCAST | IFF_POINTOPOINT)
79 77
80/* "teql*" qdisc routines */ 78/* "teql*" qdisc routines */
81 79
82static int 80static int
83teql_enqueue(struct sk_buff *skb, struct Qdisc* sch) 81teql_enqueue(struct sk_buff *skb, struct Qdisc *sch)
84{ 82{
85 struct net_device *dev = qdisc_dev(sch); 83 struct net_device *dev = qdisc_dev(sch);
86 struct teql_sched_data *q = qdisc_priv(sch); 84 struct teql_sched_data *q = qdisc_priv(sch);
@@ -97,7 +95,7 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc* sch)
97} 95}
98 96
99static struct sk_buff * 97static struct sk_buff *
100teql_dequeue(struct Qdisc* sch) 98teql_dequeue(struct Qdisc *sch)
101{ 99{
102 struct teql_sched_data *dat = qdisc_priv(sch); 100 struct teql_sched_data *dat = qdisc_priv(sch);
103 struct netdev_queue *dat_queue; 101 struct netdev_queue *dat_queue;
@@ -117,13 +115,13 @@ teql_dequeue(struct Qdisc* sch)
117} 115}
118 116
119static struct sk_buff * 117static struct sk_buff *
120teql_peek(struct Qdisc* sch) 118teql_peek(struct Qdisc *sch)
121{ 119{
122 /* teql is meant to be used as root qdisc */ 120 /* teql is meant to be used as root qdisc */
123 return NULL; 121 return NULL;
124} 122}
125 123
126static __inline__ void 124static inline void
127teql_neigh_release(struct neighbour *n) 125teql_neigh_release(struct neighbour *n)
128{ 126{
129 if (n) 127 if (n)
@@ -131,7 +129,7 @@ teql_neigh_release(struct neighbour *n)
131} 129}
132 130
133static void 131static void
134teql_reset(struct Qdisc* sch) 132teql_reset(struct Qdisc *sch)
135{ 133{
136 struct teql_sched_data *dat = qdisc_priv(sch); 134 struct teql_sched_data *dat = qdisc_priv(sch);
137 135
@@ -141,13 +139,14 @@ teql_reset(struct Qdisc* sch)
141} 139}
142 140
143static void 141static void
144teql_destroy(struct Qdisc* sch) 142teql_destroy(struct Qdisc *sch)
145{ 143{
146 struct Qdisc *q, *prev; 144 struct Qdisc *q, *prev;
147 struct teql_sched_data *dat = qdisc_priv(sch); 145 struct teql_sched_data *dat = qdisc_priv(sch);
148 struct teql_master *master = dat->m; 146 struct teql_master *master = dat->m;
149 147
150 if ((prev = master->slaves) != NULL) { 148 prev = master->slaves;
149 if (prev) {
151 do { 150 do {
152 q = NEXT_SLAVE(prev); 151 q = NEXT_SLAVE(prev);
153 if (q == sch) { 152 if (q == sch) {
@@ -179,7 +178,7 @@ teql_destroy(struct Qdisc* sch)
179static int teql_qdisc_init(struct Qdisc *sch, struct nlattr *opt) 178static int teql_qdisc_init(struct Qdisc *sch, struct nlattr *opt)
180{ 179{
181 struct net_device *dev = qdisc_dev(sch); 180 struct net_device *dev = qdisc_dev(sch);
182 struct teql_master *m = (struct teql_master*)sch->ops; 181 struct teql_master *m = (struct teql_master *)sch->ops;
183 struct teql_sched_data *q = qdisc_priv(sch); 182 struct teql_sched_data *q = qdisc_priv(sch);
184 183
185 if (dev->hard_header_len > m->dev->hard_header_len) 184 if (dev->hard_header_len > m->dev->hard_header_len)
@@ -290,7 +289,8 @@ restart:
290 nores = 0; 289 nores = 0;
291 busy = 0; 290 busy = 0;
292 291
293 if ((q = start) == NULL) 292 q = start;
293 if (!q)
294 goto drop; 294 goto drop;
295 295
296 do { 296 do {
@@ -355,10 +355,10 @@ drop:
355 355
356static int teql_master_open(struct net_device *dev) 356static int teql_master_open(struct net_device *dev)
357{ 357{
358 struct Qdisc * q; 358 struct Qdisc *q;
359 struct teql_master *m = netdev_priv(dev); 359 struct teql_master *m = netdev_priv(dev);
360 int mtu = 0xFFFE; 360 int mtu = 0xFFFE;
361 unsigned flags = IFF_NOARP|IFF_MULTICAST; 361 unsigned int flags = IFF_NOARP | IFF_MULTICAST;
362 362
363 if (m->slaves == NULL) 363 if (m->slaves == NULL)
364 return -EUNATCH; 364 return -EUNATCH;
@@ -426,7 +426,7 @@ static int teql_master_mtu(struct net_device *dev, int new_mtu)
426 do { 426 do {
427 if (new_mtu > qdisc_dev(q)->mtu) 427 if (new_mtu > qdisc_dev(q)->mtu)
428 return -EINVAL; 428 return -EINVAL;
429 } while ((q=NEXT_SLAVE(q)) != m->slaves); 429 } while ((q = NEXT_SLAVE(q)) != m->slaves);
430 } 430 }
431 431
432 dev->mtu = new_mtu; 432 dev->mtu = new_mtu;