Thread (9 messages) 9 messages, 2 authors, 2026-01-16

Re: [PATCH net-next v3 3/6] net: dsa: lantiq: allow arbitrary MII registers

From: Daniel Golle <daniel@makrotopia.org>
Date: 2026-01-16 11:47:58
Also in: lkml, netdev

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:
quoted
+__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,
	},
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help