Re: [PATCH] x86/platform/intel-mid: Use named initializer for pci_device_id array
From: Uwe Kleine-König (The Capable Hub)
Date: Wed Nov 25 2026 - 08:56:47 EST
Hello,
On Thu, May 07, 2026 at 05:40:43PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> While being more verbose using a named initializer yields easier to
> understand code and doesn't rely on the two hidden zeros in the
> PCI_VDEVICE macro.
>
> This doesn't introduce any changes to the compiled result of the array,
> which was confirmed with an ARCH=x86 build.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>
> ---
> [...]
>
> diff --git a/arch/x86/platform/intel-mid/pwr.c b/arch/x86/platform/intel-mid/pwr.c
> index cd7e0c71adde..1739971478ff 100644
> --- a/arch/x86/platform/intel-mid/pwr.c
> +++ b/arch/x86/platform/intel-mid/pwr.c
> @@ -471,8 +471,8 @@ static const struct mid_pwr_device_info tng_info = {
>
> /* This table should be in sync with the one in drivers/pci/pci-mid.c */
> static const struct pci_device_id mid_pwr_pci_ids[] = {
> - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PENWELL), (kernel_ulong_t)&pnw_info },
> - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), (kernel_ulong_t)&tng_info },
> + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PENWELL), .driver_data = (kernel_ulong_t)&pnw_info },
> + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), .driver_data = (kernel_ulong_t)&tng_info },
> {}
> };
>
Andy and I are not in agreement how these pci_device_id arrays should be
written and unless Andy let go, we won't be able to agree on the right
style.
Can we please get a maintainer feedback on this patch to be able to
progress on the pci_device_id quest?
Thanks,
Uwe
Attachment:
signature.asc
Description: PGP signature