netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] igmp: remove unnecessary in_device member zeroing
@ 2013-06-07 17:34 Shawn Bohrer
  2013-06-12  7:42 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Shawn Bohrer @ 2013-06-07 17:34 UTC (permalink / raw)
  To: netdev; +Cc: davem, Shawn Bohrer

ip_mc_init_dev() is passed a freshly kzalloc'd in_device so it is
unnecessary to explicitly zero out the members.

Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
---
P.S. If explicitly zeroing these members is desired there is still a bug
initializing in_dev->mc_count inside of the #ifdef CONFIG_IP_MULTICAST.
In practice it never matters because as I pointed out mc_count is
already initialized to zero.

 net/ipv4/igmp.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index d8c2327..a883151 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1381,13 +1381,9 @@ void ip_mc_init_dev(struct in_device *in_dev)
 {
 	ASSERT_RTNL();
 
-	in_dev->mc_tomb = NULL;
 #ifdef CONFIG_IP_MULTICAST
-	in_dev->mr_gq_running = 0;
 	setup_timer(&in_dev->mr_gq_timer, igmp_gq_timer_expire,
 			(unsigned long)in_dev);
-	in_dev->mr_ifc_count = 0;
-	in_dev->mc_count     = 0;
 	setup_timer(&in_dev->mr_ifc_timer, igmp_ifc_timer_expire,
 			(unsigned long)in_dev);
 	in_dev->mr_qrv = IGMP_Unsolicited_Report_Count;
-- 
1.7.7.6


-- 

---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] igmp: remove unnecessary in_device member zeroing
  2013-06-07 17:34 [PATCH net-next] igmp: remove unnecessary in_device member zeroing Shawn Bohrer
@ 2013-06-12  7:42 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-06-12  7:42 UTC (permalink / raw)
  To: sbohrer; +Cc: netdev

From: Shawn Bohrer <sbohrer@rgmadvisors.com>
Date: Fri,  7 Jun 2013 12:34:43 -0500

> ip_mc_init_dev() is passed a freshly kzalloc'd in_device so it is
> unnecessary to explicitly zero out the members.
> 
> Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-12  7:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-07 17:34 [PATCH net-next] igmp: remove unnecessary in_device member zeroing Shawn Bohrer
2013-06-12  7:42 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).