aboutsummaryrefslogtreecommitdiffstats
path: root/net/netrom
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-01-24 00:20:07 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:53:35 -0500
commitb24b8a247ff65c01b252025926fe564209fae4fc (patch)
tree8a9e0ea1e24b4733d8b9433d41877659505e9da4 /net/netrom
parenta92aa318b4b369091fd80433c80e62838db8bc1c (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/netrom')
-rw-r--r--net/netrom/nr_timer.c19
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)
40{ 40{
41 struct nr_sock *nr = nr_sk(sk); 41 struct nr_sock *nr = nr_sk(sk);
42 42
43 init_timer(&nr->t1timer); 43 setup_timer(&nr->t1timer, nr_t1timer_expiry, (unsigned long)sk);
44 nr->t1timer.data = (unsigned long)sk; 44 setup_timer(&nr->t2timer, nr_t2timer_expiry, (unsigned long)sk);
45 nr->t1timer.function = &nr_t1timer_expiry; 45 setup_timer(&nr->t4timer, nr_t4timer_expiry, (unsigned long)sk);
46 46 setup_timer(&nr->idletimer, nr_idletimer_expiry, (unsigned long)sk);
47 init_timer(&nr->t2timer);
48 nr->t2timer.data = (unsigned long)sk;
49 nr->t2timer.function = &nr_t2timer_expiry;
50
51 init_timer(&nr->t4timer);
52 nr->t4timer.data = (unsigned long)sk;
53 nr->t4timer.function = &nr_t4timer_expiry;
54
55 init_timer(&nr->idletimer);
56 nr->idletimer.data = (unsigned long)sk;
57 nr->idletimer.function = &nr_idletimer_expiry;
58 47
59 /* initialized by sock_init_data */ 48 /* initialized by sock_init_data */
60 sk->sk_timer.data = (unsigned long)sk; 49 sk->sk_timer.data = (unsigned long)sk;