From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752761AbdJMQLA convert rfc822-to-8bit (ORCPT ); Fri, 13 Oct 2017 12:11:00 -0400 Received: from smtp-out4.electric.net ([192.162.216.194]:62368 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752684AbdJMQK5 (ORCPT ); Fri, 13 Oct 2017 12:10:57 -0400 From: David Laight To: "'Vivien Didelot'" , "'Florian Fainelli'" , "netdev@vger.kernel.org" CC: Andrew Lunn , "kernel@savoirfairelinux.com" , "linux-kernel@vger.kernel.org" , "David S. Miller" Subject: RE: [PATCH net-next 5/5] net: dsa: split dsa_port's netdev member Thread-Topic: [PATCH net-next 5/5] net: dsa: split dsa_port's netdev member Thread-Index: AQHTQ66heGjrosGEzU2/zTs56vD+y6Lh0D4QgAAYhfqAAAtFMA== Date: Fri, 13 Oct 2017 16:10:50 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DD0094FEF@AcuExch.aculab.com> References: <20171012225156.20758-1-vivien.didelot@savoirfairelinux.com> <20171012225156.20758-6-vivien.didelot@savoirfairelinux.com> <5b637ea3-6c4b-1d93-ed43-09038af473f9@gmail.com> <063D6719AE5E284EB5DD2968C1650D6DD0094DFE@AcuExch.aculab.com> <87y3ofi0oi.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> <874lr3vzg4.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> In-Reply-To: <874lr3vzg4.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vivien Didelot > Sent: 13 October 2017 16:29 > Vivien Didelot writes: > > >>> How about using: > >>> > >>> union { > >>> struct net_device *master; > >>> struct net_device *slave; > >>> } netdev; > >> ... > >> > >> You can remove the 'netdev' all the compilers support unnamed unions. > > > > There are issues with older GCC versions, see the commit 42275bd8fcb3 > > ("switchdev: don't use anonymous union on switchdev attr/obj structs") > > > > That's why I kept it in the v2 I sent. > > At the same time, I can see that struct sk_buff uses anonym union a lot. > > It seems weird that one raised a compiler issue for switchdev but not > for skbuff.h... Do you think it is viable to drop the name here then? I believe the problem is with initialisers for static structures that contain anonymous unions. David