netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: vxlan: remove duplicated initialization in vxlan_xmit
@ 2024-08-10  2:06 Menglong Dong
  2024-08-11 13:58 ` Simon Horman
  2024-08-12 12:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Menglong Dong @ 2024-08-10  2:06 UTC (permalink / raw)
  To: kuba
  Cc: davem, edumazet, pabeni, idosch, amcohen, gnault, dongml2,
	b.galvani, netdev, linux-kernel

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(-)

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);
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: vxlan: remove duplicated initialization in vxlan_xmit
  2024-08-10  2:06 [PATCH net-next] net: vxlan: remove duplicated initialization in vxlan_xmit Menglong Dong
@ 2024-08-11 13:58 ` Simon Horman
  2024-08-12 12:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-08-11 13:58 UTC (permalink / raw)
  To: Menglong Dong
  Cc: kuba, davem, edumazet, pabeni, idosch, amcohen, gnault, dongml2,
	b.galvani, netdev, linux-kernel

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: vxlan: remove duplicated initialization in vxlan_xmit
  2024-08-10  2:06 [PATCH net-next] net: vxlan: remove duplicated initialization in vxlan_xmit Menglong Dong
  2024-08-11 13:58 ` Simon Horman
@ 2024-08-12 12:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-08-12 12:40 UTC (permalink / raw)
  To: Menglong Dong
  Cc: kuba, davem, edumazet, pabeni, idosch, amcohen, gnault, dongml2,
	b.galvani, netdev, linux-kernel

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-12 12:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-10  2:06 [PATCH net-next] net: vxlan: remove duplicated initialization in vxlan_xmit Menglong Dong
2024-08-11 13:58 ` Simon Horman
2024-08-12 12:40 ` patchwork-bot+netdevbpf

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).