Skip to contentSkip to conversation

net: remove unnecessary initializations in net_dev_init

PATCH Applied Sabrina Dubroca 2 participants 2 messages Jan 18, 2014 – Jan 22, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: remove unnecessary initializations in net_dev_init

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

---

v2: remove memset as well, since as Eric said, percpu data is 0 at
boot time

 net/core/dev.c | 10 ----------
 1 file changed, 10 deletions(-)
net/core/dev.c +0 -10
index 288df62..36c0cc69 100644
@@ -6997,28 +6997,18 @@ static int __init net_dev_init(void)
 	for_each_possible_cpu(i) {
 		struct softnet_data *sd = &per_cpu(softnet_data, i);
 
-		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;
Signature · 1 line
1.8.5.3