Re: [PATCH v2] leds: Use named initializers for arrays of i2c_device_data
From: Alexander Sverdlin
Date: Fri May 22 2026 - 06:57:53 EST
Hi Uwe,
On Fri, 2026-05-22 at 12:42 +0200, 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.
>
> The mentioned robustness is relevant for a planned change to struct
> i2c_device_id that replaces .driver_data by an anonymous union.
>
> While touching all these arrays, unify usage of whitespace and commas.
>
> 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@xxxxxxxxxxxx>
thanks for the re-spin!
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@xxxxxxxxx>
> ---
> Hello,
>
> Changes since v1 (available at
> https://lore.kernel.org/linux-leds/20260515163325.471175-2-u.kleine-koenig@xxxxxxxxxxxx):
>
> - s/ / / in leds-lp8501.c
> - also convert drivers/leds/leds-as3668.c which I missed due to not
> having
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b24e1049a5a53f0912046a8f4112d2d43dec74e7
> in my tree.
>
> Thanks to Alexander Sverdlin for pointing these out.
>
> Best regards
> Uwe
> ---
> drivers/leds/flash/leds-as3645a.c | 2 +-
> drivers/leds/flash/leds-lm3601x.c | 4 ++--
> drivers/leds/leds-an30259a.c | 2 +-
> drivers/leds/leds-as3668.c | 2 +-
> drivers/leds/leds-aw200xx.c | 10 +++++-----
> drivers/leds/leds-bd2802.c | 2 +-
> drivers/leds/leds-blinkm.c | 4 ++--
> drivers/leds/leds-is31fl319x.c | 22 +++++++++++-----------
> drivers/leds/leds-is31fl32xx.c | 18 +++++++++---------
> drivers/leds/leds-lm3530.c | 4 ++--
> drivers/leds/leds-lm3532.c | 4 ++--
> drivers/leds/leds-lm355x.c | 6 +++---
> drivers/leds/leds-lm3642.c | 4 ++--
> drivers/leds/leds-lm3692x.c | 4 ++--
> drivers/leds/leds-lm3697.c | 2 +-
> drivers/leds/leds-lp3944.c | 4 ++--
> drivers/leds/leds-lp3952.c | 4 ++--
> drivers/leds/leds-lp50xx.c | 12 ++++++------
> drivers/leds/leds-lp5521.c | 2 +-
> drivers/leds/leds-lp5523.c | 4 ++--
> drivers/leds/leds-lp5562.c | 2 +-
> drivers/leds/leds-lp5569.c | 2 +-
> drivers/leds/leds-lp8501.c | 2 +-
> drivers/leds/leds-lp8860.c | 2 +-
> drivers/leds/leds-lp8864.c | 4 ++--
> drivers/leds/leds-pca9532.c | 8 ++++----
> drivers/leds/leds-pca955x.c | 12 ++++++------
> drivers/leds/leds-pca963x.c | 8 ++++----
> drivers/leds/leds-pca995x.c | 8 ++++----
> drivers/leds/leds-st1202.c | 2 +-
> drivers/leds/leds-tca6507.c | 2 +-
> drivers/leds/leds-tlc591xx.c | 6 +++---
> drivers/leds/leds-turris-omnia.c | 2 +-
> drivers/leds/rgb/leds-ktd202x.c | 6 +++---
> 34 files changed, 91 insertions(+), 91 deletions(-)
--
Alexander Sverdlin.