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/iucv/af_iucv.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'net/iucv/af_iucv.c') diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index aef664580355..2255e3c082ed 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -94,13 +94,6 @@ static void iucv_sock_clear_timer(struct sock *sk) sk_stop_timer(sk, &sk->sk_timer); } -static void iucv_sock_init_timer(struct sock *sk) -{ - init_timer(&sk->sk_timer); - sk->sk_timer.function = iucv_sock_timeout; - sk->sk_timer.data = (unsigned long)sk; -} - static struct sock *__iucv_get_sock_by_name(char *nm) { struct sock *sk; @@ -238,7 +231,7 @@ static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio) sk->sk_protocol = proto; sk->sk_state = IUCV_OPEN; - iucv_sock_init_timer(sk); + setup_timer(&sk->sk_timer, iucv_sock_timeout, (unsigned long)sk); iucv_sock_link(&iucv_sk_list, sk); return sk; -- cgit v1.2.3-59-g8ed1b