[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>
This commit is contained in:
Pavel Emelyanov 2008-01-23 21:20:07 -08:00 committed by David S. Miller
parent a92aa318b4
commit b24b8a247f
47 changed files with 98 additions and 228 deletions

View file

@ -97,13 +97,6 @@ static void sco_sock_clear_timer(struct sock *sk)
sk_stop_timer(sk, &sk->sk_timer);
}
static void sco_sock_init_timer(struct sock *sk)
{
init_timer(&sk->sk_timer);
sk->sk_timer.function = sco_sock_timeout;
sk->sk_timer.data = (unsigned long)sk;
}
/* ---- SCO connections ---- */
static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status)
{
@ -436,7 +429,7 @@ static struct sock *sco_sock_alloc(struct net *net, struct socket *sock, int pro
sk->sk_protocol = proto;
sk->sk_state = BT_OPEN;
sco_sock_init_timer(sk);
setup_timer(&sk->sk_timer, sco_sock_timeout, (unsigned long)sk);
bt_sock_link(&sco_sk_list, sk);
return sk;