diff mbox series

[ovs-dev,2/2] ip_gre: remove redundant variables t_hlen

Message ID 1533678533-18145-2-git-send-email-gvrose8192@gmail.com
State Accepted
Headers show
Series [ovs-dev,1/2] ip_gre: fix IFLA_MTU ignored on NEWLINK | expand

Commit Message

Gregory Rose Aug. 7, 2018, 9:48 p.m. UTC
From: YueHaibing <yuehaibing@huawei.com>

Upstream commit:
    From: YueHaibing <yuehaibing@huawei.com>
    Date: Wed, 1 Aug 2018 10:04:02 +0800
    Subject: [PATCH] ip_gre: remove redundant variables t_hlen

    After commit ffc2b6ee4174 ("ip_gre: fix IFLA_MTU ignored on NEWLINK")
    variable t_hlen is assigned values that are never read,
    hence they are redundant and can be removed.

    Signed-off-by: YueHaibing <yuehaibing@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Cc: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/linux/compat/ip_gre.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Ben Pfaff Aug. 7, 2018, 10:05 p.m. UTC | #1
On Tue, Aug 07, 2018 at 02:48:53PM -0700, Greg Rose wrote:
> From: YueHaibing <yuehaibing@huawei.com>
> 
> Upstream commit:
>     From: YueHaibing <yuehaibing@huawei.com>
>     Date: Wed, 1 Aug 2018 10:04:02 +0800
>     Subject: [PATCH] ip_gre: remove redundant variables t_hlen
> 
>     After commit ffc2b6ee4174 ("ip_gre: fix IFLA_MTU ignored on NEWLINK")
>     variable t_hlen is assigned values that are never read,
>     hence they are redundant and can be removed.
> 
>     Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
> 
> Cc: YueHaibing <yuehaibing@huawei.com>
> Signed-off-by: Greg Rose <gvrose8192@gmail.com>

These looked like straightforward backports so I applied them to master.

It's not clear to me whether they fixed any bugs so I didn't backport
them, please let me know if I should.
Gregory Rose Aug. 7, 2018, 10:12 p.m. UTC | #2
On 8/7/2018 3:05 PM, Ben Pfaff wrote:
> On Tue, Aug 07, 2018 at 02:48:53PM -0700, Greg Rose wrote:
>> From: YueHaibing <yuehaibing@huawei.com>
>>
>> Upstream commit:
>>      From: YueHaibing <yuehaibing@huawei.com>
>>      Date: Wed, 1 Aug 2018 10:04:02 +0800
>>      Subject: [PATCH] ip_gre: remove redundant variables t_hlen
>>
>>      After commit ffc2b6ee4174 ("ip_gre: fix IFLA_MTU ignored on NEWLINK")
>>      variable t_hlen is assigned values that are never read,
>>      hence they are redundant and can be removed.
>>
>>      Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>      Signed-off-by: David S. Miller <davem@davemloft.net>
>>
>> Cc: YueHaibing <yuehaibing@huawei.com>
>> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
> These looked like straightforward backports so I applied them to master.
>
> It's not clear to me whether they fixed any bugs so I didn't backport
> them, please let me know if I should.

This is another one that touches erspan code so I don't think it will go 
much further back than 2.10.

Thanks!

- Greg
0-day Robot Aug. 7, 2018, 10:37 p.m. UTC | #3
Bleep bloop.  Greetings Greg Rose, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Too many signoffs; are you missing Co-authored-by lines?
Lines checked: 55, Warnings: 0, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@bytheb.org

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index 47ee525..47ed5e0 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -681,7 +681,6 @@  err_free_skb:
 static void __gre_tunnel_init(struct net_device *dev)
 {
 	struct ip_tunnel *tunnel;
-	int t_hlen;
 
 	tunnel = netdev_priv(dev);
 	tunnel->tun_hlen = ip_gre_calc_hlen(tunnel->parms.o_flags);
@@ -689,8 +688,6 @@  static void __gre_tunnel_init(struct net_device *dev)
 
 	tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen;
 
-	t_hlen = tunnel->hlen + sizeof(struct iphdr);
-
 	dev->features		|= GRE_FEATURES;
 	dev->hw_features	|= GRE_FEATURES;
 
@@ -1031,13 +1028,11 @@  EXPORT_SYMBOL_GPL(ovs_gre_fill_metadata_dst);
 static int erspan_tunnel_init(struct net_device *dev)
 {
 	struct ip_tunnel *tunnel = netdev_priv(dev);
-	int t_hlen;
 
 	tunnel->tun_hlen = 8;
 	tunnel->parms.iph.protocol = IPPROTO_GRE;
 	tunnel->hlen = tunnel->tun_hlen + tunnel->encap_hlen +
 		       erspan_hdr_len(tunnel->erspan_ver);
-	t_hlen = tunnel->hlen + sizeof(struct iphdr);
 
 	dev->features		|= GRE_FEATURES;
 	dev->hw_features	|= GRE_FEATURES;