From: David S. Miller Date: Fri, 6 May 2011 22:06:01 +0000 (-0700) Subject: ipv4: Initialize on-stack cork more efficiently. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b80d72261aec5e763a76497eba5fddc84833a154;p=linux-beck.git ipv4: Initialize on-stack cork more efficiently. 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 Acked-by: Eric Dumazet --- diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index eb0647a2f073..5f5fe4f742b9 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);