diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-01-23 21:20:07 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 14:53:35 -0800 |
commit | b24b8a247ff65c01b252025926fe564209fae4fc (patch) | |
tree | 8a9e0ea1e24b4733d8b9433d41877659505e9da4 /net/netrom | |
parent | a92aa318b4b369091fd80433c80e62838db8bc1c (diff) | |
download | linux-b24b8a247ff65c01b252025926fe564209fae4fc.tar.gz linux-b24b8a247ff65c01b252025926fe564209fae4fc.tar.bz2 linux-b24b8a247ff65c01b252025926fe564209fae4fc.zip |
[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/netrom')
-rw-r--r-- | net/netrom/nr_timer.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/net/netrom/nr_timer.c b/net/netrom/nr_timer.c index 6cfaad952c6c..1cb98e88f5e1 100644 --- a/net/netrom/nr_timer.c +++ b/net/netrom/nr_timer.c @@ -40,21 +40,10 @@ void nr_init_timers(struct sock *sk) { struct nr_sock *nr = nr_sk(sk); - init_timer(&nr->t1timer); - nr->t1timer.data = (unsigned long)sk; - nr->t1timer.function = &nr_t1timer_expiry; - - init_timer(&nr->t2timer); - nr->t2timer.data = (unsigned long)sk; - nr->t2timer.function = &nr_t2timer_expiry; - - init_timer(&nr->t4timer); - nr->t4timer.data = (unsigned long)sk; - nr->t4timer.function = &nr_t4timer_expiry; - - init_timer(&nr->idletimer); - nr->idletimer.data = (unsigned long)sk; - nr->idletimer.function = &nr_idletimer_expiry; + setup_timer(&nr->t1timer, nr_t1timer_expiry, (unsigned long)sk); + setup_timer(&nr->t2timer, nr_t2timer_expiry, (unsigned long)sk); + setup_timer(&nr->t4timer, nr_t4timer_expiry, (unsigned long)sk); + setup_timer(&nr->idletimer, nr_idletimer_expiry, (unsigned long)sk); /* initialized by sock_init_data */ sk->sk_timer.data = (unsigned long)sk; |