]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xen/platform-pci: Simplify initialization of pci_device_id array
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Tue, 5 May 2026 10:29:09 +0000 (12:29 +0200)
committerJuergen Gross <jgross@suse.com>
Mon, 8 Jun 2026 06:57:25 +0000 (08:57 +0200)
Instead of using a list initializer---that is hard to read unless you know
the structure of struct pci_device_id by heart---use the PCI_VDEVICE
macro to assign the needed values and drop all explicit but unneeded
zeros.

This doesn't introduce any changes to the compiled result of the array.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20260505102909.2380470-2-u.kleine-koenig@baylibre.com>

drivers/xen/platform-pci.c

index 1db82da56db62beab2a36a91faaada3e4183f4d6..f2438232518c2cc93572e18643ea53f6dab39ac7 100644 (file)
@@ -174,11 +174,9 @@ pci_out:
 }
 
 static const struct pci_device_id platform_pci_tbl[] = {
-       {PCI_VENDOR_ID_XEN, PCI_DEVICE_ID_XEN_PLATFORM,
-               PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-       {PCI_VENDOR_ID_XEN, PCI_DEVICE_ID_XEN_PLATFORM_XS61,
-               PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-       {0,}
+       { PCI_VDEVICE(XEN, PCI_DEVICE_ID_XEN_PLATFORM) },
+       { PCI_VDEVICE(XEN, PCI_DEVICE_ID_XEN_PLATFORM_XS61) },
+       { }
 };
 
 static const struct dev_pm_ops platform_pm_ops = {