From b24b8a247ff65c01b252025926fe564209fae4fc Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Wed, 23 Jan 2008 21:20:07 -0800 Subject: [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 Acked-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller --- net/appletalk/aarp.c | 4 +--- net/appletalk/ddp.c | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'net/appletalk') diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c index 6c5c6dc098ec..b950fb6bd2bf 100644 --- a/net/appletalk/aarp.c +++ b/net/appletalk/aarp.c @@ -874,9 +874,7 @@ void __init aarp_proto_init(void) aarp_dl = register_snap_client(aarp_snap_id, aarp_rcv); if (!aarp_dl) printk(KERN_CRIT "Unable to register AARP with SNAP.\n"); - init_timer(&aarp_timer); - aarp_timer.function = aarp_expire_timeout; - aarp_timer.data = 0; + setup_timer(&aarp_timer, aarp_expire_timeout, 0); aarp_timer.expires = jiffies + sysctl_aarp_expiry_time; add_timer(&aarp_timer); register_netdevice_notifier(&aarp_notifier); diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index e0d37d6dc1f8..3be55c8ca4ef 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -177,10 +177,9 @@ static inline void atalk_destroy_socket(struct sock *sk) if (atomic_read(&sk->sk_wmem_alloc) || atomic_read(&sk->sk_rmem_alloc)) { - init_timer(&sk->sk_timer); + setup_timer(&sk->sk_timer, atalk_destroy_timer, + (unsigned long)sk); sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME; - sk->sk_timer.function = atalk_destroy_timer; - sk->sk_timer.data = (unsigned long)sk; add_timer(&sk->sk_timer); } else sock_put(sk); -- cgit v1.2.3