aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/mcast.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-01-24 00:20:07 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:53:35 -0500
commitb24b8a247ff65c01b252025926fe564209fae4fc (patch)
tree8a9e0ea1e24b4733d8b9433d41877659505e9da4 /net/ipv6/mcast.c
parenta92aa318b4b369091fd80433c80e62838db8bc1c (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/ipv6/mcast.c')
-rw-r--r--net/ipv6/mcast.c14
1 files changed, 5 insertions, 9 deletions
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;