mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "u.kleine-koenig@baylibre.com" <u.kleine-koenig@baylibre.com>
To: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
Cc: "linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] leds: Use named initializers for arrays of i2c_device_data
Date: Mon, 18 May 2026 16:33:37 +0200	[thread overview]
Message-ID: <agsgRWNCh3oKSKLQ@monoceros> (raw)
In-Reply-To: <b8223eeed0835423b39cfb59e080efb362f347e2.camel@siemens.com>

[-- Attachment #1: Type: text/plain, Size: 2566 bytes --]

Hello,

On Mon, May 18, 2026 at 09:53:42AM +0000, Sverdlin, Alexander wrote:
> On Fri, 2026-05-15 at 18:33 +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@baylibre.com>
> 
> the patch looks good overall, except one minor nit below and the fact that
> https://kernel.googlesource.com/pub/scm/linux/kernel/git/lee/leds for-leds-next
> branch already has commit c7dd343a37567e650c263d4c068418b0bb82bf79
> ("leds: as3668: Driver for the ams Osram 4-channel i2c LED driver"), which is
> not converted. Would it make sense to rebase and convert as3668 driver as well?

My tree is based on v7.1-rc1 and I expect to have missed some more
drivers. So I'm well aware that I won't be done with the quest when I
sent one patch per subsystem. I hesitate to base my development on top
of next because I juggle ~100 patches currently and there are more to
come.

I plan to address the missed drivers separately, so my preference would
be to not stop this patch from going in because of that missed driver,
but I adapt to whatever the LED maintainers POV is on that.
 
> > diff --git a/drivers/leds/leds-lp8501.c b/drivers/leds/leds-lp8501.c
> > index ee4ff4586bc0..946c27fd74cc 100644
> > --- a/drivers/leds/leds-lp8501.c
> > +++ b/drivers/leds/leds-lp8501.c
> > @@ -130,7 +130,7 @@ static struct lp55xx_device_config lp8501_cfg = {
> >  };
> >  
> >  static const struct i2c_device_id lp8501_id[] = {
> > -	{ "lp8501",  .driver_data = (kernel_ulong_t)&lp8501_cfg, },
> > +	{ .name = "lp8501",  .driver_data = (kernel_ulong_t)&lp8501_cfg },
>                            ^^
> duplicate whitespace

Ah right, the double space is also in the source and my script kept
that. I fixed that in my tree, so if it comes to a v2 this will be
fixed.

Thanks for your feedback.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-05-18 14:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15 16:33 Uwe Kleine-König (The Capable Hub)
2026-05-18  9:53 ` Sverdlin, Alexander
2026-05-18 14:33   ` u.kleine-koenig [this message]
2026-05-18 14:51 ` Sverdlin, Alexander

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=agsgRWNCh3oKSKLQ@monoceros \
    --to=u.kleine-koenig@baylibre.com \
    --cc=alexander.sverdlin@siemens.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®