diff mbox series

[net-next] net: vxlan: remove duplicated initialization in vxlan_xmit

Message ID 20240810020632.367019-1-dongml2@chinatelecom.cn (mailing list archive)
State Accepted
Commit 6b8a024d25ebf7535eb4a3e926309aa693cfe1bd
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: vxlan: remove duplicated initialization in vxlan_xmit | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 29 this patch: 29
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 29 this patch: 29
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 30 this patch: 30
netdev/checkpatch warning WARNING: From:/Signed-off-by: email address mismatch: 'From: Menglong Dong <menglong8.dong@gmail.com>' != 'Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>'
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-10--18-00 (tests: 707)

Commit Message

Menglong Dong Aug. 10, 2024, 2:06 a.m. UTC
The variable "did_rsc" is initialized twice, which is unnecessary. Just
remove one of them.

Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
---
 drivers/net/vxlan/vxlan_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Aug. 11, 2024, 1:58 p.m. UTC | #1
On Sat, Aug 10, 2024 at 10:06:32AM +0800, Menglong Dong wrote:
> The variable "did_rsc" is initialized twice, which is unnecessary. Just
> remove one of them.
> 
> Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>

Thanks, I have verified that did_rsc is initialised to false,
else where in this function, before it is otherwise used.

And, as the function may return before then, it does seem
reasonable to defer initialisation until then.

Reviewed-by: Simon Horman <horms@kernel.org>
patchwork-bot+netdevbpf@kernel.org Aug. 12, 2024, 12:40 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Sat, 10 Aug 2024 10:06:32 +0800 you wrote:
> The variable "did_rsc" is initialized twice, which is unnecessary. Just
> remove one of them.
> 
> Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
> ---
>  drivers/net/vxlan/vxlan_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] net: vxlan: remove duplicated initialization in vxlan_xmit
    https://git.kernel.org/netdev/net-next/c/6b8a024d25eb

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index fa3c4e08044a..0ddb2eca744d 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -2710,11 +2710,11 @@  static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct vxlan_dev *vxlan = netdev_priv(dev);
 	struct vxlan_rdst *rdst, *fdst = NULL;
 	const struct ip_tunnel_info *info;
-	bool did_rsc = false;
 	struct vxlan_fdb *f;
 	struct ethhdr *eth;
 	__be32 vni = 0;
 	u32 nhid = 0;
+	bool did_rsc;
 
 	info = skb_tunnel_info(skb);