Netdev List
 help / color / mirror / Atom feed
* [PATCH v1] dpll: zl3073x: Use named initializers for struct i2c_device_id
@ 2026-05-19 14:27 Uwe Kleine-König (The Capable Hub)
  2026-05-20  6:48 ` Ivan Vecera
  2026-05-21  2:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-19 14:27 UTC (permalink / raw)
  To: Ivan Vecera, Prathosh Satish, Vadim Fedorenko,
	Arkadiusz Kubalewski, Jiri Pirko
  Cc: netdev, linux-kernel

While being less compact, using named initializers allows to more easily
see which members of the structs are assigned which value without having
to lookup the declaration of the struct. And it's also more robust
against changes to the struct definition.

This patch doesn't modify the compiled arrays, only their representation
in source form benefits. The former was confirmed with x86 and arm64
builds.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
Hello,

this patch is part of a bigger quest to use named initializers for
mainly struct i2c_device_id::driver_data to be able to modify
i2c_device_id. See e.g.
https://lore.kernel.org/all/20260518111203.639603-2-u.kleine-koenig@baylibre.com/
for the details.

This patch here isn't critical for this quest, as no driver makes use of
.driver_data, so apart from the better readability this is only about
consistency with other subsystems.

This is the only i2c driver under drivers/dpll, so this is the only
patch needed to adapt the whole system to the new style for initializing
i2c_device_id arrays.

Best regards
Uwe
---
 drivers/dpll/zl3073x/i2c.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/dpll/zl3073x/i2c.c b/drivers/dpll/zl3073x/i2c.c
index 979df85826ab..4a23340e29d0 100644
--- a/drivers/dpll/zl3073x/i2c.c
+++ b/drivers/dpll/zl3073x/i2c.c
@@ -26,11 +26,11 @@ static int zl3073x_i2c_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id zl3073x_i2c_id[] = {
-	{ "zl30731" },
-	{ "zl30732" },
-	{ "zl30733" },
-	{ "zl30734" },
-	{ "zl30735" },
+	{ .name = "zl30731" },
+	{ .name = "zl30732" },
+	{ .name = "zl30733" },
+	{ .name = "zl30734" },
+	{ .name = "zl30735" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(i2c, zl3073x_i2c_id);

base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] dpll: zl3073x: Use named initializers for struct i2c_device_id
  2026-05-19 14:27 [PATCH v1] dpll: zl3073x: Use named initializers for struct i2c_device_id Uwe Kleine-König (The Capable Hub)
@ 2026-05-20  6:48 ` Ivan Vecera
  2026-05-21  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Ivan Vecera @ 2026-05-20  6:48 UTC (permalink / raw)
  To: Uwe Kleine-König (The Capable Hub), Prathosh Satish,
	Vadim Fedorenko, Arkadiusz Kubalewski, Jiri Pirko
  Cc: netdev, linux-kernel

On 5/19/26 4:27 PM, Uwe Kleine-König (The Capable Hub) wrote:
> While being less compact, using named initializers allows to more easily
> see which members of the structs are assigned which value without having
> to lookup the declaration of the struct. And it's also more robust
> against changes to the struct definition.
> 
> This patch doesn't modify the compiled arrays, only their representation
> in source form benefits. The former was confirmed with x86 and arm64
> builds.
> 
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>

LGTM...

Reviewed-by: Ivan Vecera <ivecera@redhat.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] dpll: zl3073x: Use named initializers for struct i2c_device_id
  2026-05-19 14:27 [PATCH v1] dpll: zl3073x: Use named initializers for struct i2c_device_id Uwe Kleine-König (The Capable Hub)
  2026-05-20  6:48 ` Ivan Vecera
@ 2026-05-21  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-05-21  2:10 UTC (permalink / raw)
  To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=28The_Capable_Hub=29_=3Cu=2Ekleine-koenig?=,
	=?utf-8?q?=40baylibre=2Ecom=3E?=
  Cc: ivecera, Prathosh.Satish, vadim.fedorenko, arkadiusz.kubalewski,
	jiri, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 19 May 2026 16:27:10 +0200 you wrote:
> While being less compact, using named initializers allows to more easily
> see which members of the structs are assigned which value without having
> to lookup the declaration of the struct. And it's also more robust
> against changes to the struct definition.
> 
> This patch doesn't modify the compiled arrays, only their representation
> in source form benefits. The former was confirmed with x86 and arm64
> builds.
> 
> [...]

Here is the summary with links:
  - [v1] dpll: zl3073x: Use named initializers for struct i2c_device_id
    https://git.kernel.org/netdev/net-next/c/a09dfac0296d

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-21  2:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19 14:27 [PATCH v1] dpll: zl3073x: Use named initializers for struct i2c_device_id Uwe Kleine-König (The Capable Hub)
2026-05-20  6:48 ` Ivan Vecera
2026-05-21  2:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox