[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aWolXoaMUr-vlKxh@makrotopia.org>
Date: Fri, 16 Jan 2026 11:47:42 +0000
From: Daniel Golle <daniel@...rotopia.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Hauke Mehrtens <hauke@...ke-m.de>, Andrew Lunn <andrew@...n.ch>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Chen Minqiang <ptpt52@...il.com>,
Xinfa Deng <xinfa.deng@...inet.com>
Subject: Re: [PATCH net-next v3 3/6] net: dsa: lantiq: allow arbitrary MII
registers
On Thu, Jan 15, 2026 at 07:11:08PM -0800, Jakub Kicinski wrote:
> On Fri, 16 Jan 2026 00:07:37 +0000 Daniel Golle wrote:
> > +__diag_push();
> > +__diag_ignore_all("-Woverride-init",
> > + "logic to initialize all and then override some is OK");
>
> This seems quite unjustified to save at a glance 4 lines of code.
So I'll spell it out instead. I kinda like the notion of default
initializers, it's much more obviously correct and impossible to
accidentally leave anything uninitialized (or rather wrongly initialized
with 0).
In lantiq_gswip.c it would look like this then:
.mii_cfg = {
[0] = GSWIP_MII_CFGp(0),
[1] = GSWIP_MII_CFGp(1),
[2 ... 4] = -1,
[5] = GSWIP_MII_CFGp(5),
[6] = -1,
},
.mii_pcdu = {
[0] = GSWIP_MII_PCDU0,
[1] = GSWIP_MII_PCDU1,
[2 ... 4] = -1,
[5] = GSWIP_MII_PCDU5,
[6] = -1,
},
...
.mii_cfg = {
[0] = GSWIP_MII_CFGp(0),
[1 ... 4] = -1,
[5] = GSWIP_MII_CFGp(5),
[6] = -1,
},
.mii_pcdu = {
[0] = GSWIP_MII_PCDU0,
[1 ... 4] = -1,
[5] = GSWIP_MII_PCDU5,
[6] = -1,
},
Powered by blists - more mailing lists