Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753922AbdHWLwb (ORCPT ); Wed, 23 Aug 2017 07:52:31 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:33990 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753844AbdHWLw3 (ORCPT ); Wed, 23 Aug 2017 07:52:29 -0400 Subject: Re: [PATCH][netdev-next] gre: remove duplicated assignment of iph To: Colin King , "David S . Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev@vger.kernel.org References: <20170823111305.19185-1-colin.king@canonical.com> Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, William Tu From: Nikolay Aleksandrov X-Enigmail-Draft-Status: N1110 Message-ID: Date: Wed, 23 Aug 2017 14:52:26 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170823111305.19185-1-colin.king@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1081 Lines: 35 On 23/08/17 14:13, Colin King wrote: > From: Colin Ian King > > iph is being assigned the same value twice; remove the redundant > second assignment. > > Fixes warning: > net/ipv4/ip_gre.c:265:2: warning: Value stored to 'iph' is never read > > Signed-off-by: Colin Ian King > --- > net/ipv4/ip_gre.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c > index 6e8a62289e03..6b3e7c99a3b6 100644 > --- a/net/ipv4/ip_gre.c > +++ b/net/ipv4/ip_gre.c > @@ -268,7 +268,6 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi, > if (unlikely(!pskb_may_pull(skb, len))) > return -ENOMEM; > > - iph = ip_hdr(skb); > ershdr = (struct erspanhdr *)(skb->data + gre_hdr_len); > > /* The original GRE header does not have key field, > This one looks like a correct assignment, I'd remove the previous one because pskb_may_pull may change the header pointers and the previously assigned iph might become wrong. Also add the author of the code to the CC list.