diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-01-24 00:20:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:53:35 -0500 |
commit | b24b8a247ff65c01b252025926fe564209fae4fc (patch) | |
tree | 8a9e0ea1e24b4733d8b9433d41877659505e9da4 /net/sched | |
parent | a92aa318b4b369091fd80433c80e62838db8bc1c (diff) |
[NET]: Convert init_timer into setup_timer
Many-many code in the kernel initialized the timer->function
and timer->data together with calling init_timer(timer). There
is already a helper for this. Use it for networking code.
The patch is HUGE, but makes the code 130 lines shorter
(98 insertions(+), 228 deletions(-)).
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_generic.c | 9 | ||||
-rw-r--r-- | net/sched/sch_sfq.c | 4 |
2 files changed, 2 insertions, 11 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index e595e6570ce0..84c048a54799 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -211,13 +211,6 @@ static void dev_watchdog(unsigned long arg) | |||
211 | dev_put(dev); | 211 | dev_put(dev); |
212 | } | 212 | } |
213 | 213 | ||
214 | static void dev_watchdog_init(struct net_device *dev) | ||
215 | { | ||
216 | init_timer(&dev->watchdog_timer); | ||
217 | dev->watchdog_timer.data = (unsigned long)dev; | ||
218 | dev->watchdog_timer.function = dev_watchdog; | ||
219 | } | ||
220 | |||
221 | void __netdev_watchdog_up(struct net_device *dev) | 214 | void __netdev_watchdog_up(struct net_device *dev) |
222 | { | 215 | { |
223 | if (dev->tx_timeout) { | 216 | if (dev->tx_timeout) { |
@@ -608,7 +601,7 @@ void dev_init_scheduler(struct net_device *dev) | |||
608 | INIT_LIST_HEAD(&dev->qdisc_list); | 601 | INIT_LIST_HEAD(&dev->qdisc_list); |
609 | qdisc_unlock_tree(dev); | 602 | qdisc_unlock_tree(dev); |
610 | 603 | ||
611 | dev_watchdog_init(dev); | 604 | setup_timer(&dev->watchdog_timer, dev_watchdog, (unsigned long)dev); |
612 | } | 605 | } |
613 | 606 | ||
614 | void dev_shutdown(struct net_device *dev) | 607 | void dev_shutdown(struct net_device *dev) |
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index b542c875e154..65293876cd66 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -426,9 +426,7 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt) | |||
426 | struct sfq_sched_data *q = qdisc_priv(sch); | 426 | struct sfq_sched_data *q = qdisc_priv(sch); |
427 | int i; | 427 | int i; |
428 | 428 | ||
429 | init_timer(&q->perturb_timer); | 429 | setup_timer(&q->perturb_timer, sfq_perturbation, (unsigned long)sch); |
430 | q->perturb_timer.data = (unsigned long)sch; | ||
431 | q->perturb_timer.function = sfq_perturbation; | ||
432 | 430 | ||
433 | for (i=0; i<SFQ_HASH_DIVISOR; i++) | 431 | for (i=0; i<SFQ_HASH_DIVISOR; i++) |
434 | q->ht[i] = SFQ_DEPTH; | 432 | q->ht[i] = SFQ_DEPTH; |