Re: [PATCH] i3c: Consistently define pci_device_ids using named initializers
From: Uwe Kleine-König (The Capable Hub)
Date: Tue May 05 2026 - 01:50:32 EST
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@xxxxxxxxxxxx>
> > ---
> > 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@xxxxxxxxxxxx/)
> > 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.
Best regards
Uwe
Attachment:
signature.asc
Description: PGP signature