* Re: [PATCH] i3c: Consistently define pci_device_ids using named initializers
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
2026-05-05 5:50 ` Uwe Kleine-König (The Capable Hub)
2026-05-05 9:20 ` Adrian Hunter
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Frank Li @ 2026-05-04 20:42 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Alexandre Belloni, Markus Schneider-Pargmann, Adrian Hunter,
Jarkko Nikula, linux-i3c, linux-kernel
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.
Frank
>
> (together with the respective change in the code when the value is
> used). This gets rid of a bunch of casts and thus slightly improves type
> safety.
>
> Best regards
> Uwe
>
> .../master/mipi-i3c-hci/mipi-i3c-hci-pci.c | 22 +++++++++----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
> index 9468786fb853..5a9e2a43eff8 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
> @@ -461,21 +461,21 @@ static const struct dev_pm_ops mipi_i3c_hci_pci_pm_ops = {
>
> static const struct pci_device_id mipi_i3c_hci_pci_devices[] = {
> /* Wildcat Lake-U */
> - { PCI_VDEVICE(INTEL, 0x4d7c), (kernel_ulong_t)&intel_mi_1_info},
> - { PCI_VDEVICE(INTEL, 0x4d6f), (kernel_ulong_t)&intel_si_2_info},
> + { PCI_VDEVICE(INTEL, 0x4d7c), .driver_data = (kernel_ulong_t)&intel_mi_1_info },
> + { PCI_VDEVICE(INTEL, 0x4d6f), .driver_data = (kernel_ulong_t)&intel_si_2_info },
> /* Panther Lake-H */
> - { PCI_VDEVICE(INTEL, 0xe37c), (kernel_ulong_t)&intel_mi_1_info},
> - { PCI_VDEVICE(INTEL, 0xe36f), (kernel_ulong_t)&intel_si_2_info},
> + { PCI_VDEVICE(INTEL, 0xe37c), .driver_data = (kernel_ulong_t)&intel_mi_1_info },
> + { PCI_VDEVICE(INTEL, 0xe36f), .driver_data = (kernel_ulong_t)&intel_si_2_info },
> /* Panther Lake-P */
> - { PCI_VDEVICE(INTEL, 0xe47c), (kernel_ulong_t)&intel_mi_1_info},
> - { PCI_VDEVICE(INTEL, 0xe46f), (kernel_ulong_t)&intel_si_2_info},
> + { PCI_VDEVICE(INTEL, 0xe47c), .driver_data = (kernel_ulong_t)&intel_mi_1_info },
> + { PCI_VDEVICE(INTEL, 0xe46f), .driver_data = (kernel_ulong_t)&intel_si_2_info },
> /* Nova Lake-S */
> - { PCI_VDEVICE(INTEL, 0x6e2c), (kernel_ulong_t)&intel_mi_1_info},
> - { PCI_VDEVICE(INTEL, 0x6e2d), (kernel_ulong_t)&intel_mi_2_info},
> + { PCI_VDEVICE(INTEL, 0x6e2c), .driver_data = (kernel_ulong_t)&intel_mi_1_info },
> + { PCI_VDEVICE(INTEL, 0x6e2d), .driver_data = (kernel_ulong_t)&intel_mi_2_info },
> /* Nova Lake-H */
> - { PCI_VDEVICE(INTEL, 0xd37c), (kernel_ulong_t)&intel_mi_1_info},
> - { PCI_VDEVICE(INTEL, 0xd36f), (kernel_ulong_t)&intel_mi_2_info},
> - { },
> + { PCI_VDEVICE(INTEL, 0xd37c), .driver_data = (kernel_ulong_t)&intel_mi_1_info },
> + { PCI_VDEVICE(INTEL, 0xd36f), .driver_data = (kernel_ulong_t)&intel_mi_2_info },
> + { }
> };
> MODULE_DEVICE_TABLE(pci, mipi_i3c_hci_pci_devices);
>
>
> base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
> --
> 2.47.3
>
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] i3c: Consistently define pci_device_ids using named initializers
2026-05-04 20:42 ` Frank Li
@ 2026-05-05 5:50 ` Uwe Kleine-König (The Capable Hub)
2026-05-05 18:48 ` Frank Li
0 siblings, 1 reply; 7+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-05 5:50 UTC (permalink / raw)
To: Frank Li
Cc: Alexandre Belloni, Markus Schneider-Pargmann, Adrian Hunter,
Jarkko Nikula, linux-i3c, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1620 bytes --]
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.
Best regards
Uwe
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 111 bytes --]
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] i3c: Consistently define pci_device_ids using named initializers
2026-05-05 5:50 ` Uwe Kleine-König (The Capable Hub)
@ 2026-05-05 18:48 ` Frank Li
0 siblings, 0 replies; 7+ messages in thread
From: Frank Li @ 2026-05-05 18:48 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Alexandre Belloni, Markus Schneider-Pargmann, Adrian Hunter,
Jarkko Nikula, linux-i3c, linux-kernel
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] i3c: Consistently define pci_device_ids using named initializers
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
@ 2026-05-05 9:20 ` Adrian Hunter
2026-06-11 15:35 ` Uwe Kleine-König (The Capable Hub)
2026-06-14 20:39 ` Alexandre Belloni
3 siblings, 0 replies; 7+ messages in thread
From: Adrian Hunter @ 2026-05-05 9:20 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub), Alexandre Belloni
Cc: Markus Schneider-Pargmann, Frank Li, Jarkko Nikula, linux-i3c,
linux-kernel
On 04/05/2026 17:33, 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>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.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 },
>
> (together with the respective change in the code when the value is
> used). This gets rid of a bunch of casts and thus slightly improves type
> safety.
>
> Best regards
> Uwe
>
> .../master/mipi-i3c-hci/mipi-i3c-hci-pci.c | 22 +++++++++----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
> index 9468786fb853..5a9e2a43eff8 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
> @@ -461,21 +461,21 @@ static const struct dev_pm_ops mipi_i3c_hci_pci_pm_ops = {
>
> static const struct pci_device_id mipi_i3c_hci_pci_devices[] = {
> /* Wildcat Lake-U */
> - { PCI_VDEVICE(INTEL, 0x4d7c), (kernel_ulong_t)&intel_mi_1_info},
> - { PCI_VDEVICE(INTEL, 0x4d6f), (kernel_ulong_t)&intel_si_2_info},
> + { PCI_VDEVICE(INTEL, 0x4d7c), .driver_data = (kernel_ulong_t)&intel_mi_1_info },
> + { PCI_VDEVICE(INTEL, 0x4d6f), .driver_data = (kernel_ulong_t)&intel_si_2_info },
> /* Panther Lake-H */
> - { PCI_VDEVICE(INTEL, 0xe37c), (kernel_ulong_t)&intel_mi_1_info},
> - { PCI_VDEVICE(INTEL, 0xe36f), (kernel_ulong_t)&intel_si_2_info},
> + { PCI_VDEVICE(INTEL, 0xe37c), .driver_data = (kernel_ulong_t)&intel_mi_1_info },
> + { PCI_VDEVICE(INTEL, 0xe36f), .driver_data = (kernel_ulong_t)&intel_si_2_info },
> /* Panther Lake-P */
> - { PCI_VDEVICE(INTEL, 0xe47c), (kernel_ulong_t)&intel_mi_1_info},
> - { PCI_VDEVICE(INTEL, 0xe46f), (kernel_ulong_t)&intel_si_2_info},
> + { PCI_VDEVICE(INTEL, 0xe47c), .driver_data = (kernel_ulong_t)&intel_mi_1_info },
> + { PCI_VDEVICE(INTEL, 0xe46f), .driver_data = (kernel_ulong_t)&intel_si_2_info },
> /* Nova Lake-S */
> - { PCI_VDEVICE(INTEL, 0x6e2c), (kernel_ulong_t)&intel_mi_1_info},
> - { PCI_VDEVICE(INTEL, 0x6e2d), (kernel_ulong_t)&intel_mi_2_info},
> + { PCI_VDEVICE(INTEL, 0x6e2c), .driver_data = (kernel_ulong_t)&intel_mi_1_info },
> + { PCI_VDEVICE(INTEL, 0x6e2d), .driver_data = (kernel_ulong_t)&intel_mi_2_info },
> /* Nova Lake-H */
> - { PCI_VDEVICE(INTEL, 0xd37c), (kernel_ulong_t)&intel_mi_1_info},
> - { PCI_VDEVICE(INTEL, 0xd36f), (kernel_ulong_t)&intel_mi_2_info},
> - { },
> + { PCI_VDEVICE(INTEL, 0xd37c), .driver_data = (kernel_ulong_t)&intel_mi_1_info },
> + { PCI_VDEVICE(INTEL, 0xd36f), .driver_data = (kernel_ulong_t)&intel_mi_2_info },
> + { }
> };
> MODULE_DEVICE_TABLE(pci, mipi_i3c_hci_pci_devices);
>
>
> base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] i3c: Consistently define pci_device_ids using named initializers
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
2026-05-05 9:20 ` Adrian Hunter
@ 2026-06-11 15:35 ` Uwe Kleine-König (The Capable Hub)
2026-06-14 20:39 ` Alexandre Belloni
3 siblings, 0 replies; 7+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-06-11 15:35 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Markus Schneider-Pargmann, Frank Li, Adrian Hunter, Jarkko Nikula,
linux-i3c, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 710 bytes --]
Hello,
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>
Given the feedback for this patch was positive and there is no change to
the compiled result, I wonder if it's still possible to get this into
v7.2-rc1?!
Best regards
Uwe
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 111 bytes --]
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] i3c: Consistently define pci_device_ids using named initializers
2026-05-04 14:33 [PATCH] i3c: Consistently define pci_device_ids using named initializers Uwe Kleine-König (The Capable Hub)
` (2 preceding siblings ...)
2026-06-11 15:35 ` Uwe Kleine-König (The Capable Hub)
@ 2026-06-14 20:39 ` Alexandre Belloni
3 siblings, 0 replies; 7+ messages in thread
From: Alexandre Belloni @ 2026-06-14 20:39 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Markus Schneider-Pargmann, Frank Li, Adrian Hunter, Jarkko Nikula,
linux-i3c, linux-kernel
On Mon, 04 May 2026 16:33:15 +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.
>
> [...]
Applied, thanks!
[1/1] i3c: Consistently define pci_device_ids using named initializers
https://git.kernel.org/i3c/c/9972c11b2a1b
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 7+ messages in thread