* [PATCH] net: vrf: avoid gcc-4.6 warning
@ 2017-09-12 20:10 Arnd Bergmann
2017-09-15 21:22 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-09-12 20:10 UTC (permalink / raw)
To: David Ahern, Shrijeet Mukherjee
Cc: Arnd Bergmann, David S. Miller, Julian Anastasov,
Matthias Schiffer, Wei Wang, netdev, linux-kernel
When building an allmodconfig kernel with gcc-4.6, we get a rather
odd warning:
drivers/net/vrf.c: In function ‘vrf_ip6_input_dst’:
drivers/net/vrf.c:964:3: error: initialized field with side-effects overwritten [-Werror]
drivers/net/vrf.c:964:3: error: (near initialization for ‘fl6’) [-Werror]
I have no idea what this warning is even trying to say, but it does
seem like a false positive. Reordering the initialization in to match
the structure definition gets rid of the warning, and might also avoid
whatever gcc thinks is wrong here.
Fixes: 9ff74384600a ("net: vrf: Handle ipv6 multicast and link-local addresses")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/vrf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 7e19051f3230..9b243e6f3008 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -957,12 +957,12 @@ static void vrf_ip6_input_dst(struct sk_buff *skb, struct net_device *vrf_dev,
{
const struct ipv6hdr *iph = ipv6_hdr(skb);
struct flowi6 fl6 = {
+ .flowi6_iif = ifindex,
+ .flowi6_mark = skb->mark,
+ .flowi6_proto = iph->nexthdr,
.daddr = iph->daddr,
.saddr = iph->saddr,
.flowlabel = ip6_flowinfo(iph),
- .flowi6_mark = skb->mark,
- .flowi6_proto = iph->nexthdr,
- .flowi6_iif = ifindex,
};
struct net *net = dev_net(vrf_dev);
struct rt6_info *rt6;
--
2.9.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: vrf: avoid gcc-4.6 warning
2017-09-12 20:10 [PATCH] net: vrf: avoid gcc-4.6 warning Arnd Bergmann
@ 2017-09-15 21:22 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-09-15 21:22 UTC (permalink / raw)
To: arnd; +Cc: dsa, shm, ja, mschiffer, weiwan, netdev, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 12 Sep 2017 22:10:53 +0200
> When building an allmodconfig kernel with gcc-4.6, we get a rather
> odd warning:
>
> drivers/net/vrf.c: In function ‘vrf_ip6_input_dst’:
> drivers/net/vrf.c:964:3: error: initialized field with side-effects overwritten [-Werror]
> drivers/net/vrf.c:964:3: error: (near initialization for ‘fl6’) [-Werror]
>
> I have no idea what this warning is even trying to say, but it does
> seem like a false positive. Reordering the initialization in to match
> the structure definition gets rid of the warning, and might also avoid
> whatever gcc thinks is wrong here.
>
> Fixes: 9ff74384600a ("net: vrf: Handle ipv6 multicast and link-local addresses")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
That's extremely weird, I can't explain it either.
Oh well, applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-15 21:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-12 20:10 [PATCH] net: vrf: avoid gcc-4.6 warning Arnd Bergmann
2017-09-15 21:22 ` David Miller
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).