Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1218820 > unrolled thread

[PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning

Started byGeert Uytterhoeven <geert@linux-m68k.org>
First post2015-09-04 12:50 +0200
Last post2015-09-07 04:50 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning Geert Uytterhoeven <geert@linux-m68k.org> - 2015-09-04 12:50 +0200
    Re: [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler  warning Jiri Benc <jbenc@redhat.com> - 2015-09-04 15:10 +0200
    Re: [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler  warning Thomas Graf <tgraf@suug.ch> - 2015-09-04 17:10 +0200
    Re: [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill  compiler warning David Miller <davem@davemloft.net> - 2015-09-07 04:50 +0200

#1218820 — [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2015-09-04 12:50 +0200
Subject[PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning
Message-ID<q4WJb-86i-19@gated-at.bofh.it>
drivers/net/vxlan.c: In function ‘vxlan_udp_encap_recv’:
drivers/net/vxlan.c:1226: warning: ‘info’ may be used uninitialized in this function

While this warning is a false positive, it can be killed easily by
getting rid of the pointer intermediary and referring directly to the
ip_tunnel_info structure.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Compile-tested only.
---
 drivers/net/vxlan.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index ce988fd01b3486c7..cf8b7f0473b3985a 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1223,7 +1223,6 @@ drop:
 static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
 {
 	struct metadata_dst *tun_dst = NULL;
-	struct ip_tunnel_info *info;
 	struct vxlan_sock *vs;
 	struct vxlanhdr *vxh;
 	u32 flags, vni;
@@ -1270,8 +1269,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
 		if (!tun_dst)
 			goto drop;
 
-		info = &tun_dst->u.tun_info;
-		md = ip_tunnel_info_opts(info);
+		md = ip_tunnel_info_opts(&tun_dst->u.tun_info);
 	} else {
 		memset(md, 0, sizeof(*md));
 	}
@@ -1286,7 +1284,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
 		md->gbp = ntohs(gbp->policy_id);
 
 		if (tun_dst)
-			info->key.tun_flags |= TUNNEL_VXLAN_OPT;
+			tun_dst->u.tun_info.key.tun_flags |= TUNNEL_VXLAN_OPT;
 
 		if (gbp->dont_learn)
 			md->gbp |= VXLAN_GBP_DONT_LEARN;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1218908 — Re: [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning

FromJiri Benc <jbenc@redhat.com>
Date2015-09-04 15:10 +0200
SubjectRe: [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning
Message-ID<q4YUF-2WE-1@gated-at.bofh.it>
In reply to#1218820
On Fri,  4 Sep 2015 12:49:32 +0200, Geert Uytterhoeven wrote:
> drivers/net/vxlan.c: In function ‘vxlan_udp_encap_recv’:
> drivers/net/vxlan.c:1226: warning: ‘info’ may be used uninitialized in this function
> 
> While this warning is a false positive, it can be killed easily by
> getting rid of the pointer intermediary and referring directly to the
> ip_tunnel_info structure.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Reviewed-by: Jiri Benc <jbenc@redhat.com>

-- 
Jiri Benc
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1219105 — Re: [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning

FromThomas Graf <tgraf@suug.ch>
Date2015-09-04 17:10 +0200
SubjectRe: [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning
Message-ID<q50MO-5FD-23@gated-at.bofh.it>
In reply to#1218820
On 09/04/15 at 12:49pm, Geert Uytterhoeven wrote:
> drivers/net/vxlan.c: In function ‘vxlan_udp_encap_recv’:
> drivers/net/vxlan.c:1226: warning: ‘info’ may be used uninitialized in this function
> 
> While this warning is a false positive, it can be killed easily by
> getting rid of the pointer intermediary and referring directly to the
> ip_tunnel_info structure.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Acked-by: Thomas Graf <tgraf@suug.ch>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1219905 — Re: [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning

FromDavid Miller <davem@davemloft.net>
Date2015-09-07 04:50 +0200
SubjectRe: [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning
Message-ID<q5UFk-SF-13@gated-at.bofh.it>
In reply to#1218820
RnJvbTogR2VlcnQgVXl0dGVyaG9ldmVuIDxnZWVydEBsaW51eC1tNjhrLm9yZz4NCkRhdGU6IEZy
aSwgIDQgU2VwIDIwMTUgMTI6NDk6MzIgKzAyMDANCg0KPiBkcml2ZXJzL25ldC92eGxhbi5jOiBJ
biBmdW5jdGlvbiChdnhsYW5fdWRwX2VuY2FwX3JlY3aiOg0KPiBkcml2ZXJzL25ldC92eGxhbi5j
OjEyMjY6IHdhcm5pbmc6IKFpbmZvoiBtYXkgYmUgdXNlZCB1bmluaXRpYWxpemVkIGluIHRoaXMg
ZnVuY3Rpb24NCj4gDQo+IFdoaWxlIHRoaXMgd2FybmluZyBpcyBhIGZhbHNlIHBvc2l0aXZlLCBp
dCBjYW4gYmUga2lsbGVkIGVhc2lseSBieQ0KPiBnZXR0aW5nIHJpZCBvZiB0aGUgcG9pbnRlciBp
bnRlcm1lZGlhcnkgYW5kIHJlZmVycmluZyBkaXJlY3RseSB0byB0aGUNCj4gaXBfdHVubmVsX2lu
Zm8gc3RydWN0dXJlLg0KPiANCj4gU2lnbmVkLW9mZi1ieTogR2VlcnQgVXl0dGVyaG9ldmVuIDxn
ZWVydEBsaW51eC1tNjhrLm9yZz4NCg0KQXBwbGllZCwgdGhhbmtzLg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web