From: Eric Dumazet Date: Tue, 24 Aug 2010 21:45:09 +0000 (-0700) Subject: net: ip_append_data() optim X-Git-Tag: v5.15~27691^2~697 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ec550d246e38e1b4ea8604b5c71ccb72e38f3290;p=mirror_ubuntu-kernels.git net: ip_append_data() optim Compiler is not smart enough to avoid a conditional branch. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 6d2753c7ffdd..e42762023c27 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -837,10 +837,9 @@ int ip_append_data(struct sock *sk, inet->cork.length = 0; sk->sk_sndmsg_page = NULL; sk->sk_sndmsg_off = 0; - if ((exthdrlen = rt->dst.header_len) != 0) { - length += exthdrlen; - transhdrlen += exthdrlen; - } + exthdrlen = rt->dst.header_len; + length += exthdrlen; + transhdrlen += exthdrlen; } else { rt = (struct rtable *)inet->cork.dst; if (inet->cork.flags & IPCORK_OPT)