aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-01-23 21:20:07 -0800
committerDavid S. Miller <davem@davemloft.net>2008-01-28 14:53:35 -0800
commitb24b8a247ff65c01b252025926fe564209fae4fc (patch)
tree8a9e0ea1e24b4733d8b9433d41877659505e9da4 /net/bluetooth/l2cap.c
parent[IPV6]: Add raw6 drops counter. (diff)
downloadlinux-dev-b24b8a247ff65c01b252025926fe564209fae4fc.tar.xz
linux-dev-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/bluetooth/l2cap.c')
-rw-r--r--net/bluetooth/l2cap.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 477e052b17b5..a8811c0a0cea 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -99,13 +99,6 @@ static void l2cap_sock_clear_timer(struct sock *sk)
sk_stop_timer(sk, &sk->sk_timer);
}
-static void l2cap_sock_init_timer(struct sock *sk)
-{
- init_timer(&sk->sk_timer);
- sk->sk_timer.function = l2cap_sock_timeout;
- sk->sk_timer.data = (unsigned long)sk;
-}
-
/* ---- L2CAP channels ---- */
static struct sock *__l2cap_get_chan_by_dcid(struct l2cap_chan_list *l, u16 cid)
{
@@ -395,9 +388,7 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
conn->feat_mask = 0;
- init_timer(&conn->info_timer);
- conn->info_timer.function = l2cap_info_timeout;
- conn->info_timer.data = (unsigned long) conn;
+ setup_timer(&conn->info_timer, l2cap_info_timeout, (unsigned long)conn);
spin_lock_init(&conn->lock);
rwlock_init(&conn->chan_list.lock);
@@ -622,7 +613,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int p
sk->sk_protocol = proto;
sk->sk_state = BT_OPEN;
- l2cap_sock_init_timer(sk);
+ setup_timer(&sk->sk_timer, l2cap_sock_timeout, (unsigned long)sk);
bt_sock_link(&l2cap_sk_list, sk);
return sk;