aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/igmp.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/ipv4/igmp.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/ipv4/igmp.c')
-rw-r--r--net/ipv4/igmp.c14
1 files changed, 5 insertions, 9 deletions
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