From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932886AbcHCUh0 (ORCPT ); Wed, 3 Aug 2016 16:37:26 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:36780 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932499AbcHCUhT (ORCPT ); Wed, 3 Aug 2016 16:37:19 -0400 Subject: Re: net: vrf: Handle ipv6 multicast and link-local addresses To: Geert Uytterhoeven References: <20160727215224.EB4E26611D4@gitolite.kernel.org> <1d0eb1d8-708f-2238-37c9-b75004804065@cumulusnetworks.com> Cc: "netdev@vger.kernel.org" , Linux Kernel Mailing List From: David Ahern Message-ID: Date: Wed, 3 Aug 2016 14:36:34 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/3/16 2:27 PM, Geert Uytterhoeven wrote: > On Wed, Aug 3, 2016 at 10:11 PM, David Ahern wrote: >> On 8/3/16 1:57 PM, Geert Uytterhoeven wrote: >>>> +static void vrf_ip6_input_dst(struct sk_buff *skb, struct net_device *vrf_dev, >>>>> + int ifindex) >>>>> +{ >>>>> + const struct ipv6hdr *iph = ipv6_hdr(skb); >>>>> + struct flowi6 fl6 = { >>>>> + .daddr = iph->daddr, >>>>> + .saddr = iph->saddr, >>>>> + .flowlabel = ip6_flowinfo(iph), >>> The above assignment causes the following compiler warning with >>> m68k-linux-gnu-gcc-4.1: >>> >>> drivers/net/vrf.c: In function ‘vrf_ip6_input_dst’: >>> drivers/net/vrf.c:870: warning: initialized field with >>> side-effects overwritten >>> drivers/net/vrf.c:870: warning: (near initialization for ‘fl6’) >>> >>> Unfortunately I have no idea what it means, nor do I see what's wrong >>> with the code. >> >> no idea. Fields are initialized once and left and right data types are the same. >> >> Can you remove one line at a time? Line 870 is ".flowi6_proto = iph->nexthdr," but all of the flowi6 macros are unique references to unique fields in flowi_common. The flowlabel line you point out is a unique field as well. > > The only thing that seems to matter is assigning the result of the call to > ip6_flowinfo() to .flowlabel. Assigning a constant makes the warning go away. No complaints for the same initialization style at line 151?