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 /net/core/neighbour.c | |
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>
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r-- | net/core/neighbour.c | 12 |
1 files changed, 3 insertions, 9 deletions
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 | ||