* [PATCH net-next] ip_gre: remove redundant variables t_hlen
@ 2018-08-01 2:04 YueHaibing
2018-08-01 16:58 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2018-08-01 2:04 UTC (permalink / raw)
To: davem, kuznet, yoshfuji; +Cc: linux-kernel, netdev, YueHaibing
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>
---
net/ipv4/ip_gre.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index c8ca5d8..51a5d06 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -985,7 +985,6 @@ static void ipgre_tunnel_setup(struct net_device *dev)
static void __gre_tunnel_init(struct net_device *dev)
{
struct ip_tunnel *tunnel;
- int t_hlen;
tunnel = netdev_priv(dev);
tunnel->tun_hlen = gre_calc_hlen(tunnel->parms.o_flags);
@@ -993,8 +992,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;
@@ -1304,13 +1301,11 @@ static const struct net_device_ops gre_tap_netdev_ops = {
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;
--
2.7.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] ip_gre: remove redundant variables t_hlen
2018-08-01 2:04 [PATCH net-next] ip_gre: remove redundant variables t_hlen YueHaibing
@ 2018-08-01 16:58 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-08-01 16:58 UTC (permalink / raw)
To: yuehaibing; +Cc: kuznet, yoshfuji, linux-kernel, netdev
From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 1 Aug 2018 10:04:02 +0800
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-01 17:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01 2:04 [PATCH net-next] ip_gre: remove redundant variables t_hlen YueHaibing
2018-08-01 16:58 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).