From: Denis V. Lunev Date: Sat, 22 Mar 2008 23:35:00 +0000 (-0700) Subject: [IPV4]: Remove unnecessary check for opt->is_data in ip_options_compile. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=10fe7d85e2e4042f703a10bed4123f2105eadad2;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [IPV4]: Remove unnecessary check for opt->is_data in ip_options_compile. There is the only way to reach ip_options compile with opt != NULL: ip_options_get_finish opt->is_data = 1; ip_options_compile(opt, NULL) So, checking for is_data inside opt != NULL branch is not needed. Signed-off-by: Denis V. Lunev Signed-off-by: David S. Miller --- diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index df93a9c2efda..7e94bf850a07 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c @@ -267,8 +267,7 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb) optptr = iph + sizeof(struct iphdr); opt->is_data = 0; } else { - optptr = opt->is_data ? opt->__data : - (unsigned char *)&(ip_hdr(skb)[1]); + optptr = opt->__data; iph = optptr - sizeof(struct iphdr); }