Skip to contentSkip to conversation

vxlan: hide unused local variable

PATCH Applied Arnd Bergmann 4 participants 6 messages Nov 7, 2016 – Nov 10, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vxlan: hide unused local variable

A bugfix introduced a harmless warning in v4.9-rc4:

drivers/net/vxlan.c: In function 'vxlan_group_used':
drivers/net/vxlan.c:947:21: error: unused variable 'sock6' [-Werror=unused-variable]

This hides the variable inside of the same #ifdef that is around its user. The extraneous initialization is removed at the same time, it was accidentally introduced in the same commit.

Fixes c6fcc4fc5f8b ("vxlan: avoid using stale vxlan socket.")
---
 drivers/net/vxlan.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/vxlan.c +3 -1
index cb5cc7c03160..5264c1a49d86 100644
@@ -944,7 +944,9 @@ static bool vxlan_group_used(struct vxlan_net *vn, struct vxlan_dev *dev)
 {
 	struct vxlan_dev *vxlan;
 	struct vxlan_sock *sock4;
-	struct vxlan_sock *sock6 = NULL;
+#if IS_ENABLED(CONFIG_IPV6)
+	struct vxlan_sock *sock6;
+#endif
 	unsigned short family = dev->default_dst.remote_ip.sa.sa_family;
 
 	sock4 = rtnl_dereference(dev->vn4_sock);
Signature · 1 line
2.9.0

A message that is not in the archive (sent off-list or not yet received): CAOrHB_BRnCmka_cQ1ALnOC1Yta7c8_KWrQ7tzr2tX2fbvOjs7g@mail.gmail.com

#2 lore raw
Quoted 13 lines · CET Pravin Shelar
Quoted 11 lines · Arnd Bergmann

A bugfix introduced a harmless warning in v4.9-rc4:

drivers/net/vxlan.c: In function 'vxlan_group_used':
drivers/net/vxlan.c:947:21: error: unused variable 'sock6' [-Werror=unused-variable]

This hides the variable inside of the same #ifdef that is around its user. The extraneous initialization is removed at the same time, it was accidentally introduced in the same commit.

Quoted 8 lines
Quoted 3 lines
Fixes c6fcc4fc5f8b ("vxlan: avoid using stale vxlan socket.")
Signed-off-by Arnd Bergmann <[email protected] <javascript:;>>

---

I have already submitted patch to fix this issue.

https://patchwork.ozlabs.org/patch/691588/

You have tagged those seven patches for net-next which seems appropriate, but as I wrote above the commit that introduced it was merged between -rc3 and -rc4, so I think we still need a fix for v4.9, right?

Arnd

#3 lore raw
Quoted 19 lines · Arnd Bergmann
Quoted 18 lines · CET Pravin Shelar
Quoted 14 lines · Arnd Bergmann

A bugfix introduced a harmless warning in v4.9-rc4:

drivers/net/vxlan.c: In function 'vxlan_group_used':
drivers/net/vxlan.c:947:21: error: unused variable 'sock6' [-Werror=unused-variable]

This hides the variable inside of the same #ifdef that is around its user. The extraneous initialization is removed at the same time, it was accidentally introduced in the same commit.

Fixes c6fcc4fc5f8b ("vxlan: avoid using stale vxlan socket.")
Signed-off-by Arnd Bergmann <[email protected] <javascript:;>>

---

Quoted 9 lines
Quoted 3 lines

I have already submitted patch to fix this issue.

https://patchwork.ozlabs.org/patch/691588/

You have tagged those seven patches for net-next which seems appropriate, but as I wrote above the commit that introduced it was merged between -rc3 and -rc4, so I think we still need a fix for v4.9, right?

This is not actual bug, So I am not sure if we need the fix for net branch.

maintainer
#4 lore raw

From: Pravin Shelar <[email protected]>
Date: Mon, 7 Nov 2016 16:25:54 -0800

Quoted 24 lines · Arnd Bergmann
Quoted 23 lines · CET Pravin Shelar
Quoted 21 lines · Arnd Bergmann
Quoted 7 lines

A bugfix introduced a harmless warning in v4.9-rc4:

drivers/net/vxlan.c: In function 'vxlan_group_used':
drivers/net/vxlan.c:947:21: error: unused variable 'sock6' [-Werror=unused-variable]

Quoted 8 lines

This hides the variable inside of the same #ifdef that is around its user. The extraneous initialization is removed at the same time, it was accidentally introduced in the same commit.

Fixes c6fcc4fc5f8b ("vxlan: avoid using stale vxlan socket.")
Signed-off-by Arnd Bergmann <[email protected] <javascript:;>>

---

I have already submitted patch to fix this issue.

https://patchwork.ozlabs.org/patch/691588/

Quoted 7 lines
Quoted 5 lines

You have tagged those seven patches for net-next which seems appropriate, but as I wrote above the commit that introduced it was merged between -rc3 and -rc4, so I think we still need a fix for v4.9, right?

This is not actual bug, So I am not sure if we need the fix for net branch.

Really ugly warnings like this really need to be fixed in 'net'.

Acked-by on v1 1/1
#5 lore raw
In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

A bugfix introduced a harmless warning in v4.9-rc4:

drivers/net/vxlan.c: In function 'vxlan_group_used':
drivers/net/vxlan.c:947:21: error: unused variable 'sock6' [-Werror=unused-variable]

Quoted 7 lines

This hides the variable inside of the same #ifdef that is around its user. The extraneous initialization is removed at the same time, it was accidentally introduced in the same commit.

Fixes c6fcc4fc5f8b ("vxlan: avoid using stale vxlan socket.")

I think this should be applied instead of Pravin's patch. It fixes just the one problem, contains the proper Fixes: tag and addresses net.git.

maintainer Applied
#6 lore raw
In reply to Arnd Bergmann

From: Arnd Bergmann <[email protected]>
Date: Mon, 7 Nov 2016 22:09:07 +0100

Quoted 5 lines

A bugfix introduced a harmless warning in v4.9-rc4:

drivers/net/vxlan.c: In function 'vxlan_group_used':
drivers/net/vxlan.c:947:21: error: unused variable 'sock6' [-Werror=unused-variable]

Quoted 7 lines

This hides the variable inside of the same #ifdef that is around its user. The extraneous initialization is removed at the same time, it was accidentally introduced in the same commit.

Fixes c6fcc4fc5f8b ("vxlan: avoid using stale vxlan socket.")

Applied.