From: Frank Li <Frank.li@nxp.com>
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
Markus Schneider-Pargmann <msp@baylibre.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Jarkko Nikula <jarkko.nikula@linux.intel.com>,
linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i3c: Consistently define pci_device_ids using named initializers
Date: Tue, 5 May 2026 14:48:52 -0400 [thread overview]
Message-ID: <afo7lOzIRijBbZ2Y@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <afmEo54iWgk54M3Y@monoceros>
On Tue, May 05, 2026 at 07:50:16AM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> On Mon, May 04, 2026 at 04:42:26PM -0400, Frank Li wrote:
> > On Mon, May 04, 2026 at 04:33:15PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> > > The .driver_data member of the various struct pci_device_id arrays were
> > > initialized by list expressions. This isn't easily readable if you're
> > > not into PCI. Using named initializers is more explicit and thus easier
> > > to parse.
> > >
> > > This change doesn't introduce changes to the compiled pci_device_id
> > > arrays. Tested on x86 and arm64.
> > >
> > > Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
> > > ---
> > > Hello,
> > >
> > > The secret plan is to make struct pci_device_id::driver_data an
> > > anonymous union (similar to
> > > https://lore.kernel.org/all/cover.1776579304.git.u.kleine-koenig@baylibre.com/)
> > > and that requires named initializers. But IMHO it's also a nice cleanup
> > > on its own.
> > >
> > > The anonymous union will allow changes like the following:
> > >
> > > - { PCI_VDEVICE(INTEL, 0x4d7c), .driver_data = (kernel_ulong_t)&intel_mi_1_info },
> > > + { PCI_VDEVICE(INTEL, 0x4d7c), .driver_data_ptr = &intel_mi_1_info },
> >
> > I think it is good. Can you directly change to to
> > { PCI_VDEVICE(INTEL, 0x4d7c), .driver_data_ptr = &intel_mi_1_info }
> >
> > I think use anonymous union {.driver_data; .driver_data_ptr} don't impact
> > the current drivers.
>
> I cannot because pci_device_id with the union cannot be initialized
> using
>
> { PCI_VDEVICE(INTEL, 0x4d7c), (kernel_ulong_t)&intel_mi_1_info },
>
> That's why all drivers must be adapted first to use named initializers.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> Best regards
> Uwe
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next prev parent reply other threads:[~2026-05-05 18:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 14:33 [PATCH] i3c: Consistently define pci_device_ids using named initializers Uwe Kleine-König (The Capable Hub)
2026-05-04 20:42 ` Frank Li
[not found] ` <afmEo54iWgk54M3Y@monoceros>
2026-05-05 18:48 ` Frank Li [this message]
2026-05-05 9:20 ` Adrian Hunter
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=afo7lOzIRijBbZ2Y@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=adrian.hunter@intel.com \
--cc=alexandre.belloni@bootlin.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=msp@baylibre.com \
--cc=u.kleine-koenig@baylibre.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