public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Hauke Mehrtens <hauke@hauke-m.de>, Andrew Lunn <andrew@lunn.ch>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Chen Minqiang <ptpt52@gmail.com>,
	Xinfa Deng <xinfa.deng@gl-inet.com>
Subject: Re: [PATCH net-next v3 3/6] net: dsa: lantiq: allow arbitrary MII registers
Date: Fri, 16 Jan 2026 11:47:42 +0000	[thread overview]
Message-ID: <aWolXoaMUr-vlKxh@makrotopia.org> (raw)
In-Reply-To: <20260115191108.1a7eac9f@kernel.org>

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,
	},

  reply	other threads:[~2026-01-16 11:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16  0:06 [PATCH net-next v3 0/6] net: dsa: lantiq: add support for Intel GSW150 Daniel Golle
2026-01-16  0:07 ` [PATCH net-next v3 1/6] dt-bindings: net: dsa: lantiq,gswip: use correct node name Daniel Golle
2026-01-16  0:07 ` [PATCH net-next v3 2/6] dt-bindings: net: dsa: lantiq,gswip: add Intel GSW150 Daniel Golle
2026-01-16  0:07 ` [PATCH net-next v3 3/6] net: dsa: lantiq: allow arbitrary MII registers Daniel Golle
2026-01-16  3:11   ` Jakub Kicinski
2026-01-16 11:47     ` Daniel Golle [this message]
2026-01-16  0:07 ` [PATCH net-next v3 4/6] net: dsa: lantiq: clean up phylink_get_caps switch statement Daniel Golle
2026-01-16  0:07 ` [PATCH net-next v3 5/6] net: dsa: mxl-gsw1xx: only setup SerDes PCS if it exists Daniel Golle
2026-01-16  0:08 ` [PATCH net-next v3 6/6] net: dsa: mxl-gsw1xx: add support for Intel GSW150 Daniel Golle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aWolXoaMUr-vlKxh@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hauke@hauke-m.de \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=ptpt52@gmail.com \
    --cc=robh@kernel.org \
    --cc=xinfa.deng@gl-inet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox