From: Sabrina Dubroca <sd@queasysnail.net>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Sabrina Dubroca <sd@queasysnail.net>
Subject: [PATCH net-next v2] net: remove unnecessary initializations in net_dev_init
Date: Sat, 18 Jan 2014 19:19:27 +0100 [thread overview]
Message-ID: <1390069167-14080-1-git-send-email-sd@queasysnail.net> (raw)
softnet_data is already set to 0, no need to use memset or initialize
specific fields to 0 or NULL afterwards.
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
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(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 288df62..36c0cc69 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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;
--
1.8.5.3
next reply other threads:[~2014-01-18 18:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-18 18:19 Sabrina Dubroca [this message]
2014-01-22 0:45 ` [PATCH net-next v2] net: remove unnecessary initializations in net_dev_init David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1390069167-14080-1-git-send-email-sd@queasysnail.net \
--to=sd@queasysnail.net \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).