diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-01-24 00:20:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:53:35 -0500 |
commit | b24b8a247ff65c01b252025926fe564209fae4fc (patch) | |
tree | 8a9e0ea1e24b4733d8b9433d41877659505e9da4 | |
parent | a92aa318b4b369091fd80433c80e62838db8bc1c (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>
47 files changed, 98 insertions, 228 deletions
diff --git a/net/802/tr.c b/net/802/tr.c index 1e115e5beab6..151855dd4599 100644 --- a/net/802/tr.c +++ b/net/802/tr.c | |||
@@ -641,10 +641,8 @@ struct net_device *alloc_trdev(int sizeof_priv) | |||
641 | 641 | ||
642 | static int __init rif_init(void) | 642 | static int __init rif_init(void) |
643 | { | 643 | { |
644 | init_timer(&rif_timer); | ||
645 | rif_timer.expires = jiffies + sysctl_tr_rif_timeout; | 644 | rif_timer.expires = jiffies + sysctl_tr_rif_timeout; |
646 | rif_timer.data = 0L; | 645 | setup_timer(&rif_timer, rif_check_expire, 0); |
647 | rif_timer.function = rif_check_expire; | ||
648 | add_timer(&rif_timer); | 646 | add_timer(&rif_timer); |
649 | 647 | ||
650 | proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops); | 648 | proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops); |
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) | |||
874 | aarp_dl = register_snap_client(aarp_snap_id, aarp_rcv); | 874 | aarp_dl = register_snap_client(aarp_snap_id, aarp_rcv); |
875 | if (!aarp_dl) | 875 | if (!aarp_dl) |
876 | printk(KERN_CRIT "Unable to register AARP with SNAP.\n"); | 876 | printk(KERN_CRIT "Unable to register AARP with SNAP.\n"); |
877 | init_timer(&aarp_timer); | 877 | setup_timer(&aarp_timer, aarp_expire_timeout, 0); |
878 | aarp_timer.function = aarp_expire_timeout; | ||
879 | aarp_timer.data = 0; | ||
880 | aarp_timer.expires = jiffies + sysctl_aarp_expiry_time; | 878 | aarp_timer.expires = jiffies + sysctl_aarp_expiry_time; |
881 | add_timer(&aarp_timer); | 879 | add_timer(&aarp_timer); |
882 | register_netdevice_notifier(&aarp_notifier); | 880 | 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) | |||
177 | 177 | ||
178 | if (atomic_read(&sk->sk_wmem_alloc) || | 178 | if (atomic_read(&sk->sk_wmem_alloc) || |
179 | atomic_read(&sk->sk_rmem_alloc)) { | 179 | atomic_read(&sk->sk_rmem_alloc)) { |
180 | init_timer(&sk->sk_timer); | 180 | setup_timer(&sk->sk_timer, atalk_destroy_timer, |
181 | (unsigned long)sk); | ||
181 | sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME; | 182 | sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME; |
182 | sk->sk_timer.function = atalk_destroy_timer; | ||
183 | sk->sk_timer.data = (unsigned long)sk; | ||
184 | add_timer(&sk->sk_timer); | 183 | add_timer(&sk->sk_timer); |
185 | } else | 184 | } else |
186 | sock_put(sk); | 185 | sock_put(sk); |
diff --git a/net/atm/lec.c b/net/atm/lec.c index 7eb1b21a0e94..0a9c4261968f 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -1789,9 +1789,8 @@ static struct lec_arp_table *make_entry(struct lec_priv *priv, | |||
1789 | } | 1789 | } |
1790 | memcpy(to_return->mac_addr, mac_addr, ETH_ALEN); | 1790 | memcpy(to_return->mac_addr, mac_addr, ETH_ALEN); |
1791 | INIT_HLIST_NODE(&to_return->next); | 1791 | INIT_HLIST_NODE(&to_return->next); |
1792 | init_timer(&to_return->timer); | 1792 | setup_timer(&to_return->timer, lec_arp_expire_arp, |
1793 | to_return->timer.function = lec_arp_expire_arp; | 1793 | (unsigned long)to_return); |
1794 | to_return->timer.data = (unsigned long)to_return; | ||
1795 | to_return->last_used = jiffies; | 1794 | to_return->last_used = jiffies; |
1796 | to_return->priv = priv; | 1795 | to_return->priv = priv; |
1797 | skb_queue_head_init(&to_return->tx_wait); | 1796 | skb_queue_head_init(&to_return->tx_wait); |
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index b4725ff317c0..a028d37ba2e0 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
@@ -330,10 +330,9 @@ void ax25_destroy_socket(ax25_cb *ax25) | |||
330 | if (atomic_read(&ax25->sk->sk_wmem_alloc) || | 330 | if (atomic_read(&ax25->sk->sk_wmem_alloc) || |
331 | atomic_read(&ax25->sk->sk_rmem_alloc)) { | 331 | atomic_read(&ax25->sk->sk_rmem_alloc)) { |
332 | /* Defer: outstanding buffers */ | 332 | /* Defer: outstanding buffers */ |
333 | init_timer(&ax25->dtimer); | 333 | setup_timer(&ax25->dtimer, ax25_destroy_timer, |
334 | (unsigned long)ax25); | ||
334 | ax25->dtimer.expires = jiffies + 2 * HZ; | 335 | ax25->dtimer.expires = jiffies + 2 * HZ; |
335 | ax25->dtimer.function = ax25_destroy_timer; | ||
336 | ax25->dtimer.data = (unsigned long)ax25; | ||
337 | add_timer(&ax25->dtimer); | 336 | add_timer(&ax25->dtimer); |
338 | } else { | 337 | } else { |
339 | struct sock *sk=ax25->sk; | 338 | struct sock *sk=ax25->sk; |
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 34d1a3c822bf..5fc7be206f62 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -208,13 +208,8 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst) | |||
208 | 208 | ||
209 | skb_queue_head_init(&conn->data_q); | 209 | skb_queue_head_init(&conn->data_q); |
210 | 210 | ||
211 | init_timer(&conn->disc_timer); | 211 | setup_timer(&conn->disc_timer, hci_conn_timeout, (unsigned long)conn); |
212 | conn->disc_timer.function = hci_conn_timeout; | 212 | setup_timer(&conn->idle_timer, hci_conn_idle, (unsigned long)conn); |
213 | conn->disc_timer.data = (unsigned long) conn; | ||
214 | |||
215 | init_timer(&conn->idle_timer); | ||
216 | conn->idle_timer.function = hci_conn_idle; | ||
217 | conn->idle_timer.data = (unsigned long) conn; | ||
218 | 213 | ||
219 | atomic_set(&conn->refcnt, 0); | 214 | atomic_set(&conn->refcnt, 0); |
220 | 215 | ||
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index 4bbacddeb49d..782a22602b86 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c | |||
@@ -811,10 +811,7 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, | |||
811 | session->intr_sock = intr_sock; | 811 | session->intr_sock = intr_sock; |
812 | session->state = BT_CONNECTED; | 812 | session->state = BT_CONNECTED; |
813 | 813 | ||
814 | init_timer(&session->timer); | 814 | setup_timer(&session->timer, hidp_idle_timeout, (unsigned long)session); |
815 | |||
816 | session->timer.function = hidp_idle_timeout; | ||
817 | session->timer.data = (unsigned long) session; | ||
818 | 815 | ||
819 | skb_queue_head_init(&session->ctrl_transmit); | 816 | skb_queue_head_init(&session->ctrl_transmit); |
820 | skb_queue_head_init(&session->intr_transmit); | 817 | skb_queue_head_init(&session->intr_transmit); |
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) | |||
99 | sk_stop_timer(sk, &sk->sk_timer); | 99 | sk_stop_timer(sk, &sk->sk_timer); |
100 | } | 100 | } |
101 | 101 | ||
102 | static void l2cap_sock_init_timer(struct sock *sk) | ||
103 | { | ||
104 | init_timer(&sk->sk_timer); | ||
105 | sk->sk_timer.function = l2cap_sock_timeout; | ||
106 | sk->sk_timer.data = (unsigned long)sk; | ||
107 | } | ||
108 | |||
109 | /* ---- L2CAP channels ---- */ | 102 | /* ---- L2CAP channels ---- */ |
110 | static struct sock *__l2cap_get_chan_by_dcid(struct l2cap_chan_list *l, u16 cid) | 103 | static struct sock *__l2cap_get_chan_by_dcid(struct l2cap_chan_list *l, u16 cid) |
111 | { | 104 | { |
@@ -395,9 +388,7 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status) | |||
395 | 388 | ||
396 | conn->feat_mask = 0; | 389 | conn->feat_mask = 0; |
397 | 390 | ||
398 | init_timer(&conn->info_timer); | 391 | setup_timer(&conn->info_timer, l2cap_info_timeout, (unsigned long)conn); |
399 | conn->info_timer.function = l2cap_info_timeout; | ||
400 | conn->info_timer.data = (unsigned long) conn; | ||
401 | 392 | ||
402 | spin_lock_init(&conn->lock); | 393 | spin_lock_init(&conn->lock); |
403 | rwlock_init(&conn->chan_list.lock); | 394 | rwlock_init(&conn->chan_list.lock); |
@@ -622,7 +613,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int p | |||
622 | sk->sk_protocol = proto; | 613 | sk->sk_protocol = proto; |
623 | sk->sk_state = BT_OPEN; | 614 | sk->sk_state = BT_OPEN; |
624 | 615 | ||
625 | l2cap_sock_init_timer(sk); | 616 | setup_timer(&sk->sk_timer, l2cap_sock_timeout, (unsigned long)sk); |
626 | 617 | ||
627 | bt_sock_link(&l2cap_sk_list, sk); | 618 | bt_sock_link(&l2cap_sk_list, sk); |
628 | return sk; | 619 | return sk; |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index e7ac6ba7ecab..d3e4e1877e6a 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -279,9 +279,7 @@ struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio) | |||
279 | if (!d) | 279 | if (!d) |
280 | return NULL; | 280 | return NULL; |
281 | 281 | ||
282 | init_timer(&d->timer); | 282 | setup_timer(&d->timer, rfcomm_dlc_timeout, (unsigned long)d); |
283 | d->timer.function = rfcomm_dlc_timeout; | ||
284 | d->timer.data = (unsigned long) d; | ||
285 | 283 | ||
286 | skb_queue_head_init(&d->tx_queue); | 284 | skb_queue_head_init(&d->tx_queue); |
287 | spin_lock_init(&d->lock); | 285 | spin_lock_init(&d->lock); |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 93ad1aae3f38..b91d3c81a73c 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -97,13 +97,6 @@ static void sco_sock_clear_timer(struct sock *sk) | |||
97 | sk_stop_timer(sk, &sk->sk_timer); | 97 | sk_stop_timer(sk, &sk->sk_timer); |
98 | } | 98 | } |
99 | 99 | ||
100 | static void sco_sock_init_timer(struct sock *sk) | ||
101 | { | ||
102 | init_timer(&sk->sk_timer); | ||
103 | sk->sk_timer.function = sco_sock_timeout; | ||
104 | sk->sk_timer.data = (unsigned long)sk; | ||
105 | } | ||
106 | |||
107 | /* ---- SCO connections ---- */ | 100 | /* ---- SCO connections ---- */ |
108 | static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) | 101 | static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status) |
109 | { | 102 | { |
@@ -436,7 +429,7 @@ static struct sock *sco_sock_alloc(struct net *net, struct socket *sock, int pro | |||
436 | sk->sk_protocol = proto; | 429 | sk->sk_protocol = proto; |
437 | sk->sk_state = BT_OPEN; | 430 | sk->sk_state = BT_OPEN; |
438 | 431 | ||
439 | sco_sock_init_timer(sk); | 432 | setup_timer(&sk->sk_timer, sco_sock_timeout, (unsigned long)sk); |
440 | 433 | ||
441 | bt_sock_link(&sco_sk_list, sk); | 434 | bt_sock_link(&sco_sk_list, sk); |
442 | return sk; | 435 | return sk; |
diff --git a/net/core/flow.c b/net/core/flow.c index 6489f4e24ecf..46b38e06e0d7 100644 --- a/net/core/flow.c +++ b/net/core/flow.c | |||
@@ -352,8 +352,7 @@ static int __init flow_cache_init(void) | |||
352 | flow_lwm = 2 * flow_hash_size; | 352 | flow_lwm = 2 * flow_hash_size; |
353 | flow_hwm = 4 * flow_hash_size; | 353 | flow_hwm = 4 * flow_hash_size; |
354 | 354 | ||
355 | init_timer(&flow_hash_rnd_timer); | 355 | setup_timer(&flow_hash_rnd_timer, flow_cache_new_hashrnd, 0); |
356 | flow_hash_rnd_timer.function = flow_cache_new_hashrnd; | ||
357 | flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD; | 356 | flow_hash_rnd_timer.expires = jiffies + FLOW_HASH_RND_PERIOD; |
358 | add_timer(&flow_hash_rnd_timer); | 357 | add_timer(&flow_hash_rnd_timer); |
359 | 358 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 29b8ee4e35d6..175bbc0a974e 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -270,9 +270,7 @@ static struct neighbour *neigh_alloc(struct neigh_table *tbl) | |||
270 | n->nud_state = NUD_NONE; | 270 | n->nud_state = NUD_NONE; |
271 | n->output = neigh_blackhole; | 271 | n->output = neigh_blackhole; |
272 | n->parms = neigh_parms_clone(&tbl->parms); | 272 | n->parms = neigh_parms_clone(&tbl->parms); |
273 | init_timer(&n->timer); | 273 | setup_timer(&n->timer, neigh_timer_handler, (unsigned long)n); |
274 | n->timer.function = neigh_timer_handler; | ||
275 | n->timer.data = (unsigned long)n; | ||
276 | 274 | ||
277 | NEIGH_CACHE_STAT_INC(tbl, allocs); | 275 | NEIGH_CACHE_STAT_INC(tbl, allocs); |
278 | n->tbl = tbl; | 276 | n->tbl = tbl; |
@@ -1372,15 +1370,11 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl) | |||
1372 | get_random_bytes(&tbl->hash_rnd, sizeof(tbl->hash_rnd)); | 1370 | get_random_bytes(&tbl->hash_rnd, sizeof(tbl->hash_rnd)); |
1373 | 1371 | ||
1374 | rwlock_init(&tbl->lock); | 1372 | rwlock_init(&tbl->lock); |
1375 | init_timer(&tbl->gc_timer); | 1373 | setup_timer(&tbl->gc_timer, neigh_periodic_timer, (unsigned long)tbl); |
1376 | tbl->gc_timer.data = (unsigned long)tbl; | ||
1377 | tbl->gc_timer.function = neigh_periodic_timer; | ||
1378 | tbl->gc_timer.expires = now + 1; | 1374 | tbl->gc_timer.expires = now + 1; |
1379 | add_timer(&tbl->gc_timer); | 1375 | add_timer(&tbl->gc_timer); |
1380 | 1376 | ||
1381 | init_timer(&tbl->proxy_timer); | 1377 | setup_timer(&tbl->proxy_timer, neigh_proxy_process, (unsigned long)tbl); |
1382 | tbl->proxy_timer.data = (unsigned long)tbl; | ||
1383 | tbl->proxy_timer.function = neigh_proxy_process; | ||
1384 | skb_queue_head_init_class(&tbl->proxy_queue, | 1378 | skb_queue_head_init_class(&tbl->proxy_queue, |
1385 | &neigh_table_proxy_queue_class); | 1379 | &neigh_table_proxy_queue_class); |
1386 | 1380 | ||
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index d694656b8800..c9c465e86281 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c | |||
@@ -760,10 +760,8 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk) | |||
760 | hctx->ccid2hctx_rttvar = -1; | 760 | hctx->ccid2hctx_rttvar = -1; |
761 | hctx->ccid2hctx_rpdupack = -1; | 761 | hctx->ccid2hctx_rpdupack = -1; |
762 | hctx->ccid2hctx_last_cong = jiffies; | 762 | hctx->ccid2hctx_last_cong = jiffies; |
763 | 763 | setup_timer(&hctx->ccid2hctx_rtotimer, ccid2_hc_tx_rto_expire, | |
764 | hctx->ccid2hctx_rtotimer.function = &ccid2_hc_tx_rto_expire; | 764 | (unsigned long)sk); |
765 | hctx->ccid2hctx_rtotimer.data = (unsigned long)sk; | ||
766 | init_timer(&hctx->ccid2hctx_rtotimer); | ||
767 | 765 | ||
768 | ccid2_hc_tx_check_sanity(hctx); | 766 | ccid2_hc_tx_check_sanity(hctx); |
769 | return 0; | 767 | return 0; |
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index d133416d3970..f56aaecb56b3 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -606,11 +606,8 @@ static int ccid3_hc_tx_init(struct ccid *ccid, struct sock *sk) | |||
606 | 606 | ||
607 | hctx->ccid3hctx_state = TFRC_SSTATE_NO_SENT; | 607 | hctx->ccid3hctx_state = TFRC_SSTATE_NO_SENT; |
608 | INIT_LIST_HEAD(&hctx->ccid3hctx_hist); | 608 | INIT_LIST_HEAD(&hctx->ccid3hctx_hist); |
609 | 609 | setup_timer(&hctx->ccid3hctx_no_feedback_timer, | |
610 | hctx->ccid3hctx_no_feedback_timer.function = | 610 | ccid3_hc_tx_no_feedback_timer, (unsigned long)sk); |
611 | ccid3_hc_tx_no_feedback_timer; | ||
612 | hctx->ccid3hctx_no_feedback_timer.data = (unsigned long)sk; | ||
613 | init_timer(&hctx->ccid3hctx_no_feedback_timer); | ||
614 | 611 | ||
615 | return 0; | 612 | return 0; |
616 | } | 613 | } |
diff --git a/net/dccp/timer.c b/net/dccp/timer.c index 3af067354bd4..8703a792b560 100644 --- a/net/dccp/timer.c +++ b/net/dccp/timer.c | |||
@@ -280,9 +280,8 @@ static void dccp_init_write_xmit_timer(struct sock *sk) | |||
280 | { | 280 | { |
281 | struct dccp_sock *dp = dccp_sk(sk); | 281 | struct dccp_sock *dp = dccp_sk(sk); |
282 | 282 | ||
283 | init_timer(&dp->dccps_xmit_timer); | 283 | setup_timer(&dp->dccps_xmit_timer, dccp_write_xmit_timer, |
284 | dp->dccps_xmit_timer.data = (unsigned long)sk; | 284 | (unsigned long)sk); |
285 | dp->dccps_xmit_timer.function = dccp_write_xmit_timer; | ||
286 | } | 285 | } |
287 | 286 | ||
288 | void dccp_init_xmit_timers(struct sock *sk) | 287 | void dccp_init_xmit_timers(struct sock *sk) |
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 0e10ff21e292..23aa3556e56f 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
@@ -1752,8 +1752,7 @@ void __init dn_route_init(void) | |||
1752 | dn_dst_ops.kmem_cachep = | 1752 | dn_dst_ops.kmem_cachep = |
1753 | kmem_cache_create("dn_dst_cache", sizeof(struct dn_route), 0, | 1753 | kmem_cache_create("dn_dst_cache", sizeof(struct dn_route), 0, |
1754 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); | 1754 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); |
1755 | init_timer(&dn_route_timer); | 1755 | setup_timer(&dn_route_timer, dn_dst_check_expire, 0); |
1756 | dn_route_timer.function = dn_dst_check_expire; | ||
1757 | dn_route_timer.expires = jiffies + decnet_dst_gc_interval * HZ; | 1756 | dn_route_timer.expires = jiffies + decnet_dst_gc_interval * HZ; |
1758 | add_timer(&dn_route_timer); | 1757 | add_timer(&dn_route_timer); |
1759 | 1758 | ||
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index f70df073c588..bc0f6252613f 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
@@ -1014,9 +1014,8 @@ static int __init aun_udp_initialise(void) | |||
1014 | 1014 | ||
1015 | skb_queue_head_init(&aun_queue); | 1015 | skb_queue_head_init(&aun_queue); |
1016 | spin_lock_init(&aun_queue_lock); | 1016 | spin_lock_init(&aun_queue_lock); |
1017 | init_timer(&ab_cleanup_timer); | 1017 | setup_timer(&ab_cleanup_timer, ab_cleanup, 0); |
1018 | ab_cleanup_timer.expires = jiffies + (HZ*2); | 1018 | ab_cleanup_timer.expires = jiffies + (HZ*2); |
1019 | ab_cleanup_timer.function = ab_cleanup; | ||
1020 | add_timer(&ab_cleanup_timer); | 1019 | add_timer(&ab_cleanup_timer); |
1021 | 1020 | ||
1022 | memset(&sin, 0, sizeof(sin)); | 1021 | memset(&sin, 0, sizeof(sin)); |
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c index 69cb6aad25be..3bca97f55d47 100644 --- a/net/ieee80211/ieee80211_module.c +++ b/net/ieee80211/ieee80211_module.c | |||
@@ -181,9 +181,8 @@ struct net_device *alloc_ieee80211(int sizeof_priv) | |||
181 | ieee->ieee802_1x = 1; /* Default to supporting 802.1x */ | 181 | ieee->ieee802_1x = 1; /* Default to supporting 802.1x */ |
182 | 182 | ||
183 | INIT_LIST_HEAD(&ieee->crypt_deinit_list); | 183 | INIT_LIST_HEAD(&ieee->crypt_deinit_list); |
184 | init_timer(&ieee->crypt_deinit_timer); | 184 | setup_timer(&ieee->crypt_deinit_timer, ieee80211_crypt_deinit_handler, |
185 | ieee->crypt_deinit_timer.data = (unsigned long)ieee; | 185 | (unsigned long)ieee); |
186 | ieee->crypt_deinit_timer.function = ieee80211_crypt_deinit_handler; | ||
187 | ieee->crypt_quiesced = 0; | 186 | ieee->crypt_quiesced = 0; |
188 | 187 | ||
189 | spin_lock_init(&ieee->lock); | 188 | spin_lock_init(&ieee->lock); |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 7dbc282d4f9f..701558564e96 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -1234,9 +1234,7 @@ void ip_mc_inc_group(struct in_device *in_dev, __be32 addr) | |||
1234 | spin_lock_init(&im->lock); | 1234 | spin_lock_init(&im->lock); |
1235 | #ifdef CONFIG_IP_MULTICAST | 1235 | #ifdef CONFIG_IP_MULTICAST |
1236 | im->tm_running=0; | 1236 | im->tm_running=0; |
1237 | init_timer(&im->timer); | 1237 | setup_timer(&im->timer, &igmp_timer_expire, (unsigned long)im); |
1238 | im->timer.data=(unsigned long)im; | ||
1239 | im->timer.function=&igmp_timer_expire; | ||
1240 | im->unsolicit_count = IGMP_Unsolicited_Report_Count; | 1238 | im->unsolicit_count = IGMP_Unsolicited_Report_Count; |
1241 | im->reporter = 0; | 1239 | im->reporter = 0; |
1242 | im->gsquery = 0; | 1240 | im->gsquery = 0; |
@@ -1338,13 +1336,11 @@ void ip_mc_init_dev(struct in_device *in_dev) | |||
1338 | in_dev->mc_tomb = NULL; | 1336 | in_dev->mc_tomb = NULL; |
1339 | #ifdef CONFIG_IP_MULTICAST | 1337 | #ifdef CONFIG_IP_MULTICAST |
1340 | in_dev->mr_gq_running = 0; | 1338 | in_dev->mr_gq_running = 0; |
1341 | init_timer(&in_dev->mr_gq_timer); | 1339 | setup_timer(&in_dev->mr_gq_timer, igmp_gq_timer_expire, |
1342 | in_dev->mr_gq_timer.data=(unsigned long) in_dev; | 1340 | (unsigned long)in_dev); |
1343 | in_dev->mr_gq_timer.function=&igmp_gq_timer_expire; | ||
1344 | in_dev->mr_ifc_count = 0; | 1341 | in_dev->mr_ifc_count = 0; |
1345 | init_timer(&in_dev->mr_ifc_timer); | 1342 | setup_timer(&in_dev->mr_ifc_timer, igmp_ifc_timer_expire, |
1346 | in_dev->mr_ifc_timer.data=(unsigned long) in_dev; | 1343 | (unsigned long)in_dev); |
1347 | in_dev->mr_ifc_timer.function=&igmp_ifc_timer_expire; | ||
1348 | in_dev->mr_qrv = IGMP_Unsolicited_Report_Count; | 1344 | in_dev->mr_qrv = IGMP_Unsolicited_Report_Count; |
1349 | #endif | 1345 | #endif |
1350 | 1346 | ||
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 8fb6ca23700a..1c2a32f6bfc4 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -277,18 +277,11 @@ void inet_csk_init_xmit_timers(struct sock *sk, | |||
277 | { | 277 | { |
278 | struct inet_connection_sock *icsk = inet_csk(sk); | 278 | struct inet_connection_sock *icsk = inet_csk(sk); |
279 | 279 | ||
280 | init_timer(&icsk->icsk_retransmit_timer); | 280 | setup_timer(&icsk->icsk_retransmit_timer, retransmit_handler, |
281 | init_timer(&icsk->icsk_delack_timer); | 281 | (unsigned long)sk); |
282 | init_timer(&sk->sk_timer); | 282 | setup_timer(&icsk->icsk_delack_timer, delack_handler, |
283 | 283 | (unsigned long)sk); | |
284 | icsk->icsk_retransmit_timer.function = retransmit_handler; | 284 | setup_timer(&sk->sk_timer, keepalive_handler, (unsigned long)sk); |
285 | icsk->icsk_delack_timer.function = delack_handler; | ||
286 | sk->sk_timer.function = keepalive_handler; | ||
287 | |||
288 | icsk->icsk_retransmit_timer.data = | ||
289 | icsk->icsk_delack_timer.data = | ||
290 | sk->sk_timer.data = (unsigned long)sk; | ||
291 | |||
292 | icsk->icsk_pending = icsk->icsk_ack.pending = 0; | 285 | icsk->icsk_pending = icsk->icsk_ack.pending = 0; |
293 | } | 286 | } |
294 | 287 | ||
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index e15e04fc6661..737910767ff1 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c | |||
@@ -66,9 +66,8 @@ void inet_frags_init(struct inet_frags *f) | |||
66 | f->nqueues = 0; | 66 | f->nqueues = 0; |
67 | atomic_set(&f->mem, 0); | 67 | atomic_set(&f->mem, 0); |
68 | 68 | ||
69 | init_timer(&f->secret_timer); | 69 | setup_timer(&f->secret_timer, inet_frag_secret_rebuild, |
70 | f->secret_timer.function = inet_frag_secret_rebuild; | 70 | (unsigned long)f); |
71 | f->secret_timer.data = (unsigned long)f; | ||
72 | f->secret_timer.expires = jiffies + f->ctl->secret_interval; | 71 | f->secret_timer.expires = jiffies + f->ctl->secret_interval; |
73 | add_timer(&f->secret_timer); | 72 | add_timer(&f->secret_timer); |
74 | } | 73 | } |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 37bb497d92af..ba6c23cdf47b 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -1889,8 +1889,7 @@ void __init ip_mr_init(void) | |||
1889 | sizeof(struct mfc_cache), | 1889 | sizeof(struct mfc_cache), |
1890 | 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, | 1890 | 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, |
1891 | NULL); | 1891 | NULL); |
1892 | init_timer(&ipmr_expire_timer); | 1892 | setup_timer(&ipmr_expire_timer, ipmr_expire_process, 0); |
1893 | ipmr_expire_timer.function=ipmr_expire_process; | ||
1894 | register_netdevice_notifier(&ip_mr_notifier); | 1893 | register_netdevice_notifier(&ip_mr_notifier); |
1895 | #ifdef CONFIG_PROC_FS | 1894 | #ifdef CONFIG_PROC_FS |
1896 | proc_net_fops_create(&init_net, "ip_mr_vif", 0, &ipmr_vif_fops); | 1895 | proc_net_fops_create(&init_net, "ip_mr_vif", 0, &ipmr_vif_fops); |
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c index 0a9f3c37e18d..a22cee43ed7c 100644 --- a/net/ipv4/ipvs/ip_vs_conn.c +++ b/net/ipv4/ipvs/ip_vs_conn.c | |||
@@ -629,9 +629,7 @@ ip_vs_conn_new(int proto, __be32 caddr, __be16 cport, __be32 vaddr, __be16 vport | |||
629 | } | 629 | } |
630 | 630 | ||
631 | INIT_LIST_HEAD(&cp->c_list); | 631 | INIT_LIST_HEAD(&cp->c_list); |
632 | init_timer(&cp->timer); | 632 | setup_timer(&cp->timer, ip_vs_conn_expire, (unsigned long)cp); |
633 | cp->timer.data = (unsigned long)cp; | ||
634 | cp->timer.function = ip_vs_conn_expire; | ||
635 | cp->protocol = proto; | 633 | cp->protocol = proto; |
636 | cp->caddr = caddr; | 634 | cp->caddr = caddr; |
637 | cp->cport = cport; | 635 | cp->cport = cport; |
diff --git a/net/ipv4/ipvs/ip_vs_est.c b/net/ipv4/ipvs/ip_vs_est.c index 7d68b80c4c19..efdd74e4fa28 100644 --- a/net/ipv4/ipvs/ip_vs_est.c +++ b/net/ipv4/ipvs/ip_vs_est.c | |||
@@ -146,9 +146,8 @@ int ip_vs_new_estimator(struct ip_vs_stats *stats) | |||
146 | write_lock_bh(&est_lock); | 146 | write_lock_bh(&est_lock); |
147 | est->next = est_list; | 147 | est->next = est_list; |
148 | if (est->next == NULL) { | 148 | if (est->next == NULL) { |
149 | init_timer(&est_timer); | 149 | setup_timer(&est_timer, estimation_timer, 0); |
150 | est_timer.expires = jiffies + 2*HZ; | 150 | est_timer.expires = jiffies + 2*HZ; |
151 | est_timer.function = estimation_timer; | ||
152 | add_timer(&est_timer); | 151 | add_timer(&est_timer); |
153 | } | 152 | } |
154 | est_list = est; | 153 | est_list = est; |
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c index ad89644ef5d2..bf8c04a57548 100644 --- a/net/ipv4/ipvs/ip_vs_lblc.c +++ b/net/ipv4/ipvs/ip_vs_lblc.c | |||
@@ -391,9 +391,8 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc) | |||
391 | /* | 391 | /* |
392 | * Hook periodic timer for garbage collection | 392 | * Hook periodic timer for garbage collection |
393 | */ | 393 | */ |
394 | init_timer(&tbl->periodic_timer); | 394 | setup_timer(&tbl->periodic_timer, ip_vs_lblc_check_expire, |
395 | tbl->periodic_timer.data = (unsigned long)tbl; | 395 | (unsigned long)tbl); |
396 | tbl->periodic_timer.function = ip_vs_lblc_check_expire; | ||
397 | tbl->periodic_timer.expires = jiffies+CHECK_EXPIRE_INTERVAL; | 396 | tbl->periodic_timer.expires = jiffies+CHECK_EXPIRE_INTERVAL; |
398 | add_timer(&tbl->periodic_timer); | 397 | add_timer(&tbl->periodic_timer); |
399 | 398 | ||
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c index 2a5ed85a3352..f50da6411378 100644 --- a/net/ipv4/ipvs/ip_vs_lblcr.c +++ b/net/ipv4/ipvs/ip_vs_lblcr.c | |||
@@ -575,9 +575,8 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc) | |||
575 | /* | 575 | /* |
576 | * Hook periodic timer for garbage collection | 576 | * Hook periodic timer for garbage collection |
577 | */ | 577 | */ |
578 | init_timer(&tbl->periodic_timer); | 578 | setup_timer(&tbl->periodic_timer, ip_vs_lblcr_check_expire, |
579 | tbl->periodic_timer.data = (unsigned long)tbl; | 579 | (unsigned long)tbl); |
580 | tbl->periodic_timer.function = ip_vs_lblcr_check_expire; | ||
581 | tbl->periodic_timer.expires = jiffies+CHECK_EXPIRE_INTERVAL; | 580 | tbl->periodic_timer.expires = jiffies+CHECK_EXPIRE_INTERVAL; |
582 | add_timer(&tbl->periodic_timer); | 581 | add_timer(&tbl->periodic_timer); |
583 | 582 | ||
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 28484f396b04..49e008568ddf 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2964,10 +2964,8 @@ int __init ip_rt_init(void) | |||
2964 | devinet_init(); | 2964 | devinet_init(); |
2965 | ip_fib_init(); | 2965 | ip_fib_init(); |
2966 | 2966 | ||
2967 | init_timer(&rt_flush_timer); | 2967 | setup_timer(&rt_flush_timer, rt_run_flush, 0); |
2968 | rt_flush_timer.function = rt_run_flush; | 2968 | setup_timer(&rt_secret_timer, rt_secret_rebuild, 0); |
2969 | init_timer(&rt_secret_timer); | ||
2970 | rt_secret_timer.function = rt_secret_rebuild; | ||
2971 | 2969 | ||
2972 | /* All the timers, started at system startup tend | 2970 | /* All the timers, started at system startup tend |
2973 | to synchronize. Perturb it a bit. | 2971 | to synchronize. Perturb it a bit. |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e8c347579da9..c0720e4659bc 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -366,9 +366,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) | |||
366 | in6_dev_hold(ndev); | 366 | in6_dev_hold(ndev); |
367 | 367 | ||
368 | #ifdef CONFIG_IPV6_PRIVACY | 368 | #ifdef CONFIG_IPV6_PRIVACY |
369 | init_timer(&ndev->regen_timer); | 369 | setup_timer(&ndev->regen_timer, ipv6_regen_rndid, (unsigned long)ndev); |
370 | ndev->regen_timer.function = ipv6_regen_rndid; | ||
371 | ndev->regen_timer.data = (unsigned long) ndev; | ||
372 | if ((dev->flags&IFF_LOOPBACK) || | 370 | if ((dev->flags&IFF_LOOPBACK) || |
373 | dev->type == ARPHRD_TUNNEL || | 371 | dev->type == ARPHRD_TUNNEL || |
374 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | 372 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 331d728c2035..17d7318ff7bf 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -903,9 +903,7 @@ int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr) | |||
903 | return -ENOMEM; | 903 | return -ENOMEM; |
904 | } | 904 | } |
905 | 905 | ||
906 | init_timer(&mc->mca_timer); | 906 | setup_timer(&mc->mca_timer, igmp6_timer_handler, (unsigned long)mc); |
907 | mc->mca_timer.function = igmp6_timer_handler; | ||
908 | mc->mca_timer.data = (unsigned long) mc; | ||
909 | 907 | ||
910 | ipv6_addr_copy(&mc->mca_addr, addr); | 908 | ipv6_addr_copy(&mc->mca_addr, addr); |
911 | mc->idev = idev; | 909 | mc->idev = idev; |
@@ -2259,14 +2257,12 @@ void ipv6_mc_init_dev(struct inet6_dev *idev) | |||
2259 | write_lock_bh(&idev->lock); | 2257 | write_lock_bh(&idev->lock); |
2260 | rwlock_init(&idev->mc_lock); | 2258 | rwlock_init(&idev->mc_lock); |
2261 | idev->mc_gq_running = 0; | 2259 | idev->mc_gq_running = 0; |
2262 | init_timer(&idev->mc_gq_timer); | 2260 | setup_timer(&idev->mc_gq_timer, mld_gq_timer_expire, |
2263 | idev->mc_gq_timer.data = (unsigned long) idev; | 2261 | (unsigned long)idev); |
2264 | idev->mc_gq_timer.function = &mld_gq_timer_expire; | ||
2265 | idev->mc_tomb = NULL; | 2262 | idev->mc_tomb = NULL; |
2266 | idev->mc_ifc_count = 0; | 2263 | idev->mc_ifc_count = 0; |
2267 | init_timer(&idev->mc_ifc_timer); | 2264 | setup_timer(&idev->mc_ifc_timer, mld_ifc_timer_expire, |
2268 | idev->mc_ifc_timer.data = (unsigned long) idev; | 2265 | (unsigned long)idev); |
2269 | idev->mc_ifc_timer.function = &mld_ifc_timer_expire; | ||
2270 | idev->mc_qrv = MLD_QRV_DEFAULT; | 2266 | idev->mc_qrv = MLD_QRV_DEFAULT; |
2271 | idev->mc_maxdelay = IGMP6_UNSOLICITED_IVAL; | 2267 | idev->mc_maxdelay = IGMP6_UNSOLICITED_IVAL; |
2272 | idev->mc_v1_seen = 0; | 2268 | idev->mc_v1_seen = 0; |
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 07dfa7fdd2a0..240b0cbfb532 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
@@ -2410,9 +2410,8 @@ bed: | |||
2410 | 2410 | ||
2411 | /* Set watchdog timer to expire in <val> ms. */ | 2411 | /* Set watchdog timer to expire in <val> ms. */ |
2412 | self->errno = 0; | 2412 | self->errno = 0; |
2413 | init_timer(&self->watchdog); | 2413 | setup_timer(&self->watchdog, irda_discovery_timeout, |
2414 | self->watchdog.function = irda_discovery_timeout; | 2414 | (unsigned long)self); |
2415 | self->watchdog.data = (unsigned long) self; | ||
2416 | self->watchdog.expires = jiffies + (val * HZ/1000); | 2415 | self->watchdog.expires = jiffies + (val * HZ/1000); |
2417 | add_timer(&(self->watchdog)); | 2416 | add_timer(&(self->watchdog)); |
2418 | 2417 | ||
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) | |||
94 | sk_stop_timer(sk, &sk->sk_timer); | 94 | sk_stop_timer(sk, &sk->sk_timer); |
95 | } | 95 | } |
96 | 96 | ||
97 | static void iucv_sock_init_timer(struct sock *sk) | ||
98 | { | ||
99 | init_timer(&sk->sk_timer); | ||
100 | sk->sk_timer.function = iucv_sock_timeout; | ||
101 | sk->sk_timer.data = (unsigned long)sk; | ||
102 | } | ||
103 | |||
104 | static struct sock *__iucv_get_sock_by_name(char *nm) | 97 | static struct sock *__iucv_get_sock_by_name(char *nm) |
105 | { | 98 | { |
106 | struct sock *sk; | 99 | struct sock *sk; |
@@ -238,7 +231,7 @@ static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio) | |||
238 | sk->sk_protocol = proto; | 231 | sk->sk_protocol = proto; |
239 | sk->sk_state = IUCV_OPEN; | 232 | sk->sk_state = IUCV_OPEN; |
240 | 233 | ||
241 | iucv_sock_init_timer(sk); | 234 | setup_timer(&sk->sk_timer, iucv_sock_timeout, (unsigned long)sk); |
242 | 235 | ||
243 | iucv_sock_link(&iucv_sk_list, sk); | 236 | iucv_sock_link(&iucv_sk_list, sk); |
244 | return sk; | 237 | return sk; |
diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c index 5c0b484237c8..441bc18f996d 100644 --- a/net/llc/llc_conn.c +++ b/net/llc/llc_conn.c | |||
@@ -831,25 +831,21 @@ static void llc_sk_init(struct sock* sk) | |||
831 | llc->inc_cntr = llc->dec_cntr = 2; | 831 | llc->inc_cntr = llc->dec_cntr = 2; |
832 | llc->dec_step = llc->connect_step = 1; | 832 | llc->dec_step = llc->connect_step = 1; |
833 | 833 | ||
834 | init_timer(&llc->ack_timer.timer); | 834 | setup_timer(&llc->ack_timer.timer, llc_conn_ack_tmr_cb, |
835 | (unsigned long)sk); | ||
835 | llc->ack_timer.expire = sysctl_llc2_ack_timeout; | 836 | llc->ack_timer.expire = sysctl_llc2_ack_timeout; |
836 | llc->ack_timer.timer.data = (unsigned long)sk; | ||
837 | llc->ack_timer.timer.function = llc_conn_ack_tmr_cb; | ||
838 | 837 | ||
839 | init_timer(&llc->pf_cycle_timer.timer); | 838 | setup_timer(&llc->pf_cycle_timer.timer, llc_conn_pf_cycle_tmr_cb, |
839 | (unsigned long)sk); | ||
840 | llc->pf_cycle_timer.expire = sysctl_llc2_p_timeout; | 840 | llc->pf_cycle_timer.expire = sysctl_llc2_p_timeout; |
841 | llc->pf_cycle_timer.timer.data = (unsigned long)sk; | ||
842 | llc->pf_cycle_timer.timer.function = llc_conn_pf_cycle_tmr_cb; | ||
843 | 841 | ||
844 | init_timer(&llc->rej_sent_timer.timer); | 842 | setup_timer(&llc->rej_sent_timer.timer, llc_conn_rej_tmr_cb, |
843 | (unsigned long)sk); | ||
845 | llc->rej_sent_timer.expire = sysctl_llc2_rej_timeout; | 844 | llc->rej_sent_timer.expire = sysctl_llc2_rej_timeout; |
846 | llc->rej_sent_timer.timer.data = (unsigned long)sk; | ||
847 | llc->rej_sent_timer.timer.function = llc_conn_rej_tmr_cb; | ||
848 | 845 | ||
849 | init_timer(&llc->busy_state_timer.timer); | 846 | setup_timer(&llc->busy_state_timer.timer, llc_conn_busy_tmr_cb, |
847 | (unsigned long)sk); | ||
850 | llc->busy_state_timer.expire = sysctl_llc2_busy_timeout; | 848 | llc->busy_state_timer.expire = sysctl_llc2_busy_timeout; |
851 | llc->busy_state_timer.timer.data = (unsigned long)sk; | ||
852 | llc->busy_state_timer.timer.function = llc_conn_busy_tmr_cb; | ||
853 | 849 | ||
854 | llc->n2 = 2; /* max retransmit */ | 850 | llc->n2 = 2; /* max retransmit */ |
855 | llc->k = 2; /* tx win size, will adjust dynam */ | 851 | llc->k = 2; /* tx win size, will adjust dynam */ |
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c index 576355a192ab..6f2ea2090322 100644 --- a/net/llc/llc_station.c +++ b/net/llc/llc_station.c | |||
@@ -688,9 +688,8 @@ int __init llc_station_init(void) | |||
688 | skb_queue_head_init(&llc_main_station.mac_pdu_q); | 688 | skb_queue_head_init(&llc_main_station.mac_pdu_q); |
689 | skb_queue_head_init(&llc_main_station.ev_q.list); | 689 | skb_queue_head_init(&llc_main_station.ev_q.list); |
690 | spin_lock_init(&llc_main_station.ev_q.lock); | 690 | spin_lock_init(&llc_main_station.ev_q.lock); |
691 | init_timer(&llc_main_station.ack_timer); | 691 | setup_timer(&llc_main_station.ack_timer, llc_station_ack_tmr_cb, |
692 | llc_main_station.ack_timer.data = (unsigned long)&llc_main_station; | 692 | (unsigned long)&llc_main_station); |
693 | llc_main_station.ack_timer.function = llc_station_ack_tmr_cb; | ||
694 | llc_main_station.ack_timer.expires = jiffies + | 693 | llc_main_station.ack_timer.expires = jiffies + |
695 | sysctl_llc_station_ack_timeout; | 694 | sysctl_llc_station_ack_timeout; |
696 | skb = alloc_skb(0, GFP_ATOMIC); | 695 | skb = alloc_skb(0, GFP_ATOMIC); |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index cfd8ee9adad0..ffe8a49d8927 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -346,11 +346,10 @@ void sta_info_init(struct ieee80211_local *local) | |||
346 | rwlock_init(&local->sta_lock); | 346 | rwlock_init(&local->sta_lock); |
347 | INIT_LIST_HEAD(&local->sta_list); | 347 | INIT_LIST_HEAD(&local->sta_list); |
348 | 348 | ||
349 | init_timer(&local->sta_cleanup); | 349 | setup_timer(&local->sta_cleanup, sta_info_cleanup, |
350 | (unsigned long)local); | ||
350 | local->sta_cleanup.expires = | 351 | local->sta_cleanup.expires = |
351 | round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL); | 352 | round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL); |
352 | local->sta_cleanup.data = (unsigned long) local; | ||
353 | local->sta_cleanup.function = sta_info_cleanup; | ||
354 | 353 | ||
355 | #ifdef CONFIG_MAC80211_DEBUGFS | 354 | #ifdef CONFIG_MAC80211_DEBUGFS |
356 | INIT_WORK(&local->sta_debugfs_add, sta_info_debugfs_add_task); | 355 | INIT_WORK(&local->sta_debugfs_add, sta_info_debugfs_add_task); |
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; |
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index ed2d65cd8010..323d42a7b360 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -345,10 +345,9 @@ void rose_destroy_socket(struct sock *sk) | |||
345 | if (atomic_read(&sk->sk_wmem_alloc) || | 345 | if (atomic_read(&sk->sk_wmem_alloc) || |
346 | atomic_read(&sk->sk_rmem_alloc)) { | 346 | atomic_read(&sk->sk_rmem_alloc)) { |
347 | /* Defer: outstanding buffers */ | 347 | /* Defer: outstanding buffers */ |
348 | init_timer(&sk->sk_timer); | 348 | setup_timer(&sk->sk_timer, rose_destroy_timer, |
349 | (unsigned long)sk); | ||
349 | sk->sk_timer.expires = jiffies + 10 * HZ; | 350 | sk->sk_timer.expires = jiffies + 10 * HZ; |
350 | sk->sk_timer.function = rose_destroy_timer; | ||
351 | sk->sk_timer.data = (unsigned long)sk; | ||
352 | add_timer(&sk->sk_timer); | 351 | add_timer(&sk->sk_timer); |
353 | } else | 352 | } else |
354 | sock_put(sk); | 353 | sock_put(sk); |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index e595e6570ce0..84c048a54799 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -211,13 +211,6 @@ static void dev_watchdog(unsigned long arg) | |||
211 | dev_put(dev); | 211 | dev_put(dev); |
212 | } | 212 | } |
213 | 213 | ||
214 | static void dev_watchdog_init(struct net_device *dev) | ||
215 | { | ||
216 | init_timer(&dev->watchdog_timer); | ||
217 | dev->watchdog_timer.data = (unsigned long)dev; | ||
218 | dev->watchdog_timer.function = dev_watchdog; | ||
219 | } | ||
220 | |||
221 | void __netdev_watchdog_up(struct net_device *dev) | 214 | void __netdev_watchdog_up(struct net_device *dev) |
222 | { | 215 | { |
223 | if (dev->tx_timeout) { | 216 | if (dev->tx_timeout) { |
@@ -608,7 +601,7 @@ void dev_init_scheduler(struct net_device *dev) | |||
608 | INIT_LIST_HEAD(&dev->qdisc_list); | 601 | INIT_LIST_HEAD(&dev->qdisc_list); |
609 | qdisc_unlock_tree(dev); | 602 | qdisc_unlock_tree(dev); |
610 | 603 | ||
611 | dev_watchdog_init(dev); | 604 | setup_timer(&dev->watchdog_timer, dev_watchdog, (unsigned long)dev); |
612 | } | 605 | } |
613 | 606 | ||
614 | void dev_shutdown(struct net_device *dev) | 607 | void dev_shutdown(struct net_device *dev) |
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index b542c875e154..65293876cd66 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -426,9 +426,7 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt) | |||
426 | struct sfq_sched_data *q = qdisc_priv(sch); | 426 | struct sfq_sched_data *q = qdisc_priv(sch); |
427 | int i; | 427 | int i; |
428 | 428 | ||
429 | init_timer(&q->perturb_timer); | 429 | setup_timer(&q->perturb_timer, sfq_perturbation, (unsigned long)sch); |
430 | q->perturb_timer.data = (unsigned long)sch; | ||
431 | q->perturb_timer.function = sfq_perturbation; | ||
432 | 430 | ||
433 | for (i=0; i<SFQ_HASH_DIVISOR; i++) | 431 | for (i=0; i<SFQ_HASH_DIVISOR; i++) |
434 | q->ht[i] = SFQ_DEPTH; | 432 | q->ht[i] = SFQ_DEPTH; |
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 013e3d3ab0f1..33ae9b01131e 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c | |||
@@ -167,11 +167,9 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a | |||
167 | sp->autoclose * HZ; | 167 | sp->autoclose * HZ; |
168 | 168 | ||
169 | /* Initilizes the timers */ | 169 | /* Initilizes the timers */ |
170 | for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i) { | 170 | for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i) |
171 | init_timer(&asoc->timers[i]); | 171 | setup_timer(&asoc->timers[i], sctp_timer_events[i], |
172 | asoc->timers[i].function = sctp_timer_events[i]; | 172 | (unsigned long)asoc); |
173 | asoc->timers[i].data = (unsigned long) asoc; | ||
174 | } | ||
175 | 173 | ||
176 | /* Pull default initialization values from the sock options. | 174 | /* Pull default initialization values from the sock options. |
177 | * Note: This assumes that the values have already been | 175 | * Note: This assumes that the values have already been |
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index d55ce83a020b..dfa109341aeb 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c | |||
@@ -99,15 +99,10 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer, | |||
99 | INIT_LIST_HEAD(&peer->send_ready); | 99 | INIT_LIST_HEAD(&peer->send_ready); |
100 | INIT_LIST_HEAD(&peer->transports); | 100 | INIT_LIST_HEAD(&peer->transports); |
101 | 101 | ||
102 | /* Set up the retransmission timer. */ | 102 | setup_timer(&peer->T3_rtx_timer, sctp_generate_t3_rtx_event, |
103 | init_timer(&peer->T3_rtx_timer); | 103 | (unsigned long)peer); |
104 | peer->T3_rtx_timer.function = sctp_generate_t3_rtx_event; | 104 | setup_timer(&peer->hb_timer, sctp_generate_heartbeat_event, |
105 | peer->T3_rtx_timer.data = (unsigned long)peer; | 105 | (unsigned long)peer); |
106 | |||
107 | /* Set up the heartbeat timer. */ | ||
108 | init_timer(&peer->hb_timer); | ||
109 | peer->hb_timer.function = sctp_generate_heartbeat_event; | ||
110 | peer->hb_timer.data = (unsigned long)peer; | ||
111 | 106 | ||
112 | /* Initialize the 64-bit random nonce sent with heartbeat. */ | 107 | /* Initialize the 64-bit random nonce sent with heartbeat. */ |
113 | get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce)); | 108 | get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce)); |
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index c98873f39aec..eed5dd9819cd 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -811,9 +811,8 @@ EXPORT_SYMBOL_GPL(rpc_free); | |||
811 | void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, int flags, const struct rpc_call_ops *tk_ops, void *calldata) | 811 | void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, int flags, const struct rpc_call_ops *tk_ops, void *calldata) |
812 | { | 812 | { |
813 | memset(task, 0, sizeof(*task)); | 813 | memset(task, 0, sizeof(*task)); |
814 | init_timer(&task->tk_timer); | 814 | setup_timer(&task->tk_timer, (void (*)(unsigned long))rpc_run_timer, |
815 | task->tk_timer.data = (unsigned long) task; | 815 | (unsigned long)task); |
816 | task->tk_timer.function = (void (*)(unsigned long)) rpc_run_timer; | ||
817 | atomic_set(&task->tk_count, 1); | 816 | atomic_set(&task->tk_count, 1); |
818 | task->tk_client = clnt; | 817 | task->tk_client = clnt; |
819 | task->tk_flags = flags; | 818 | task->tk_flags = flags; |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index cd641c8634f0..fb92f51405c5 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -1011,9 +1011,8 @@ found: | |||
1011 | INIT_LIST_HEAD(&xprt->free); | 1011 | INIT_LIST_HEAD(&xprt->free); |
1012 | INIT_LIST_HEAD(&xprt->recv); | 1012 | INIT_LIST_HEAD(&xprt->recv); |
1013 | INIT_WORK(&xprt->task_cleanup, xprt_autoclose); | 1013 | INIT_WORK(&xprt->task_cleanup, xprt_autoclose); |
1014 | init_timer(&xprt->timer); | 1014 | setup_timer(&xprt->timer, xprt_init_autodisconnect, |
1015 | xprt->timer.function = xprt_init_autodisconnect; | 1015 | (unsigned long)xprt); |
1016 | xprt->timer.data = (unsigned long) xprt; | ||
1017 | xprt->last_used = jiffies; | 1016 | xprt->last_used = jiffies; |
1018 | xprt->cwnd = RPC_INITCWND; | 1017 | xprt->cwnd = RPC_INITCWND; |
1019 | xprt->bind_index = 0; | 1018 | xprt->bind_index = 0; |
diff --git a/net/tipc/core.h b/net/tipc/core.h index e40ada964d6e..feabca580820 100644 --- a/net/tipc/core.h +++ b/net/tipc/core.h | |||
@@ -212,9 +212,7 @@ static inline void k_init_timer(struct timer_list *timer, Handler routine, | |||
212 | unsigned long argument) | 212 | unsigned long argument) |
213 | { | 213 | { |
214 | dbg("initializing timer %p\n", timer); | 214 | dbg("initializing timer %p\n", timer); |
215 | init_timer(timer); | 215 | setup_timer(timer, routine, argument); |
216 | timer->function = routine; | ||
217 | timer->data = argument; | ||
218 | } | 216 | } |
219 | 217 | ||
220 | /** | 218 | /** |
diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c index 741ce95d4ad1..753f2b64abe2 100644 --- a/net/x25/x25_link.c +++ b/net/x25/x25_link.c | |||
@@ -247,10 +247,7 @@ void x25_link_device_up(struct net_device *dev) | |||
247 | return; | 247 | return; |
248 | 248 | ||
249 | skb_queue_head_init(&nb->queue); | 249 | skb_queue_head_init(&nb->queue); |
250 | 250 | setup_timer(&nb->t20timer, x25_t20timer_expiry, (unsigned long)nb); | |
251 | init_timer(&nb->t20timer); | ||
252 | nb->t20timer.data = (unsigned long)nb; | ||
253 | nb->t20timer.function = &x25_t20timer_expiry; | ||
254 | 251 | ||
255 | dev_hold(dev); | 252 | dev_hold(dev); |
256 | nb->dev = dev; | 253 | nb->dev = dev; |
diff --git a/net/x25/x25_timer.c b/net/x25/x25_timer.c index 2af190dc5b01..d3e3e54db936 100644 --- a/net/x25/x25_timer.c +++ b/net/x25/x25_timer.c | |||
@@ -33,9 +33,7 @@ void x25_init_timers(struct sock *sk) | |||
33 | { | 33 | { |
34 | struct x25_sock *x25 = x25_sk(sk); | 34 | struct x25_sock *x25 = x25_sk(sk); |
35 | 35 | ||
36 | init_timer(&x25->timer); | 36 | setup_timer(&x25->timer, x25_timer_expiry, (unsigned long)sk); |
37 | x25->timer.data = (unsigned long)sk; | ||
38 | x25->timer.function = &x25_timer_expiry; | ||
39 | 37 | ||
40 | /* initialized by sock_init_data */ | 38 | /* initialized by sock_init_data */ |
41 | sk->sk_timer.data = (unsigned long)sk; | 39 | sk->sk_timer.data = (unsigned long)sk; |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 26b846e11bfb..df5bfa837eb3 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -196,9 +196,8 @@ struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp) | |||
196 | INIT_HLIST_NODE(&policy->byidx); | 196 | INIT_HLIST_NODE(&policy->byidx); |
197 | rwlock_init(&policy->lock); | 197 | rwlock_init(&policy->lock); |
198 | atomic_set(&policy->refcnt, 1); | 198 | atomic_set(&policy->refcnt, 1); |
199 | init_timer(&policy->timer); | 199 | setup_timer(&policy->timer, xfrm_policy_timer, |
200 | policy->timer.data = (unsigned long)policy; | 200 | (unsigned long)policy); |
201 | policy->timer.function = xfrm_policy_timer; | ||
202 | } | 201 | } |
203 | return policy; | 202 | return policy; |
204 | } | 203 | } |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index f26aaaca1fae..51866b7fab3c 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -504,12 +504,9 @@ struct xfrm_state *xfrm_state_alloc(void) | |||
504 | INIT_HLIST_NODE(&x->bydst); | 504 | INIT_HLIST_NODE(&x->bydst); |
505 | INIT_HLIST_NODE(&x->bysrc); | 505 | INIT_HLIST_NODE(&x->bysrc); |
506 | INIT_HLIST_NODE(&x->byspi); | 506 | INIT_HLIST_NODE(&x->byspi); |
507 | init_timer(&x->timer); | 507 | setup_timer(&x->timer, xfrm_timer_handler, (unsigned long)x); |
508 | x->timer.function = xfrm_timer_handler; | 508 | setup_timer(&x->rtimer, xfrm_replay_timer_handler, |
509 | x->timer.data = (unsigned long)x; | 509 | (unsigned long)x); |
510 | init_timer(&x->rtimer); | ||
511 | x->rtimer.function = xfrm_replay_timer_handler; | ||
512 | x->rtimer.data = (unsigned long)x; | ||
513 | x->curlft.add_time = get_seconds(); | 510 | x->curlft.add_time = get_seconds(); |
514 | x->lft.soft_byte_limit = XFRM_INF; | 511 | x->lft.soft_byte_limit = XFRM_INF; |
515 | x->lft.soft_packet_limit = XFRM_INF; | 512 | x->lft.soft_packet_limit = XFRM_INF; |