netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] ipv4: Initialize on-stack cork more efficiently.
@ 2011-05-06 22:26 David Miller
  2011-05-06 22:35 ` Eric Dumazet
  2011-05-06 22:44 ` Joe Perches
  0 siblings, 2 replies; 7+ messages in thread
From: David Miller @ 2011-05-06 22:26 UTC (permalink / raw)
  To: netdev; +Cc: herbert, eric.dumazet


ip_setup_cork() explicitly initializes every member of
inet_cork except flags, addr, and opt.  So we can simply
set those three members to zero instead of using a
memset() via an empty struct assignment.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/ipv4/ip_output.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index eb0647a..5f5fe4f 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1408,7 +1408,7 @@ struct sk_buff *ip_make_skb(struct sock *sk,
 			    struct ipcm_cookie *ipc, struct rtable **rtp,
 			    unsigned int flags)
 {
-	struct inet_cork cork = {};
+	struct inet_cork cork;
 	struct sk_buff_head queue;
 	int err;
 
@@ -1417,6 +1417,9 @@ struct sk_buff *ip_make_skb(struct sock *sk,
 
 	__skb_queue_head_init(&queue);
 
+	cork.flags = 0;
+	cork.addr = 0;
+	cork.opt = 0;
 	err = ip_setup_cork(sk, &cork, ipc, rtp);
 	if (err)
 		return ERR_PTR(err);
-- 
1.7.5.1


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

end of thread, other threads:[~2011-05-07  5:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-06 22:26 [PATCH 2/2] ipv4: Initialize on-stack cork more efficiently David Miller
2011-05-06 22:35 ` Eric Dumazet
2011-05-06 22:37   ` David Miller
2011-05-07  5:11   ` Eric Dumazet
2011-05-07  5:21     ` David Miller
2011-05-06 22:44 ` Joe Perches
2011-05-06 22:59   ` 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).