[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200822020431.125732-1-Jianlin.Lv@arm.com>
Date: Sat, 22 Aug 2020 10:04:31 +0800
From: Jianlin Lv <Jianlin.Lv@....com>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, Song.Zhu@....com,
Jianlin.Lv@....com, linux-kernel@...r.kernel.org
Subject: [PATCH net-next] net: Remove unnecessary intermediate variables
It is not necessary to use src/dst as an intermediate variable for
assignment operation; Delete src/dst intermediate variables to avoid
unnecessary variable declarations.
Signed-off-by: Jianlin Lv <Jianlin.Lv@....com>
---
drivers/net/vxlan.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index b9fefe27e3e8..c00ca01ebe76 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2728,12 +2728,8 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
goto tx_error;
} else if (err) {
if (info) {
- struct in_addr src, dst;
-
- src = remote_ip.sin.sin_addr;
- dst = local_ip.sin.sin_addr;
- info->key.u.ipv4.src = src.s_addr;
- info->key.u.ipv4.dst = dst.s_addr;
+ info->key.u.ipv4.src = remote_ip.sin.sin_addr.s_addr;
+ info->key.u.ipv4.dst = local_ip.sin.sin_addr.s_addr;
}
vxlan_encap_bypass(skb, vxlan, vxlan, vni, false);
dst_release(ndst);
@@ -2784,12 +2780,8 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
goto tx_error;
} else if (err) {
if (info) {
- struct in6_addr src, dst;
-
- src = remote_ip.sin6.sin6_addr;
- dst = local_ip.sin6.sin6_addr;
- info->key.u.ipv6.src = src;
- info->key.u.ipv6.dst = dst;
+ info->key.u.ipv6.src = remote_ip.sin6.sin6_addr;
+ info->key.u.ipv6.dst = local_ip.sin6.sin6_addr;
}
vxlan_encap_bypass(skb, vxlan, vxlan, vni, false);
--
2.17.1
Powered by blists - more mailing lists