netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: remove unnecessary initializations in net_dev_init
@ 2014-01-18 15:04 Sabrina Dubroca
  2014-01-18 17:40 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Sabrina Dubroca @ 2014-01-18 15:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, Sabrina Dubroca

softnet_data is set to 0 by memset, no need to initialize specific
fields to 0 or NULL afterwards.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
 net/core/dev.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 288df62..b57b44a2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7000,25 +7000,16 @@ static int __init net_dev_init(void)
 		memset(sd, 0, sizeof(*sd));
 		skb_queue_head_init(&sd->input_pkt_queue);
 		skb_queue_head_init(&sd->process_queue);
-		sd->completion_queue = NULL;
 		INIT_LIST_HEAD(&sd->poll_list);
-		sd->output_queue = NULL;
 		sd->output_queue_tailp = &sd->output_queue;
 #ifdef CONFIG_RPS
 		sd->csd.func = rps_trigger_softirq;
 		sd->csd.info = sd;
-		sd->csd.flags = 0;
 		sd->cpu = i;
 #endif
 
 		sd->backlog.poll = process_backlog;
 		sd->backlog.weight = weight_p;
-		sd->backlog.gro_list = NULL;
-		sd->backlog.gro_count = 0;
-
-#ifdef CONFIG_NET_FLOW_LIMIT
-		sd->flow_limit = NULL;
-#endif
 	}
 
 	dev_boot_phase = 0;
-- 
1.8.5.3

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

* Re: [PATCH] net: remove unnecessary initializations in net_dev_init
  2014-01-18 15:04 [PATCH] net: remove unnecessary initializations in net_dev_init Sabrina Dubroca
@ 2014-01-18 17:40 ` Eric Dumazet
  2014-01-18 18:04   ` Sabrina Dubroca
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2014-01-18 17:40 UTC (permalink / raw)
  To: Sabrina Dubroca; +Cc: davem, netdev

On Sat, 2014-01-18 at 16:04 +0100, Sabrina Dubroca wrote:
> softnet_data is set to 0 by memset, no need to initialize specific
> fields to 0 or NULL afterwards.
> 
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
> ---
>  net/core/dev.c | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 288df62..b57b44a2 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -7000,25 +7000,16 @@ static int __init net_dev_init(void)
>  		memset(sd, 0, sizeof(*sd));

Hi Sabrina

Well, if you really want, you also can remove this memset(), percpu data
defined as :

DEFINE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);

must also be zero at boot time.

Thanks !

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

* Re: [PATCH] net: remove unnecessary initializations in net_dev_init
  2014-01-18 17:40 ` Eric Dumazet
@ 2014-01-18 18:04   ` Sabrina Dubroca
  0 siblings, 0 replies; 3+ messages in thread
From: Sabrina Dubroca @ 2014-01-18 18:04 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: davem, netdev

2014-01-18, 09:40:46 -0800, Eric Dumazet wrote:
> On Sat, 2014-01-18 at 16:04 +0100, Sabrina Dubroca wrote:
> > softnet_data is set to 0 by memset, no need to initialize specific
> > fields to 0 or NULL afterwards.
> > 
> > Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
> > ---
> >  net/core/dev.c | 9 ---------
> >  1 file changed, 9 deletions(-)
> > 
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index 288df62..b57b44a2 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -7000,25 +7000,16 @@ static int __init net_dev_init(void)
> >  		memset(sd, 0, sizeof(*sd));
> 
> Hi Sabrina
> 
> Well, if you really want, you also can remove this memset(), percpu data
> defined as :
> 
> DEFINE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
> 
> must also be zero at boot time.
> 
> Thanks !

Okay, I'll send a v2.
Thanks!

-- 
Sabrina

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

end of thread, other threads:[~2014-01-18 18:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-18 15:04 [PATCH] net: remove unnecessary initializations in net_dev_init Sabrina Dubroca
2014-01-18 17:40 ` Eric Dumazet
2014-01-18 18:04   ` Sabrina Dubroca

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).