]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ntb: amd: Use named initializer for pci_device_id::driver_data
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Thu, 7 May 2026 07:41:01 +0000 (09:41 +0200)
committerJon Mason <jdmason@kudzu.us>
Sat, 27 Jun 2026 02:18:34 +0000 (22:18 -0400)
The current list initialisation depends on the well hidden two zeros in
the PCI_VDEVICE macro. Instead use a named initialisation that is more
robust and easier to understand.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/hw/amd/ntb_hw_amd.c

index df9150669ad3a446ca4dbe7b2710b4d295864f92..36bee0d8ac6cd0bccb7ad38f7b7bc4f1dfb53920 100644 (file)
@@ -1328,15 +1328,15 @@ static const struct ntb_dev_data dev_data[] = {
 };
 
 static const struct pci_device_id amd_ntb_pci_tbl[] = {
-       { PCI_VDEVICE(AMD, 0x145b), (kernel_ulong_t)&dev_data[0] },
-       { PCI_VDEVICE(AMD, 0x148b), (kernel_ulong_t)&dev_data[1] },
-       { PCI_VDEVICE(AMD, 0x14c0), (kernel_ulong_t)&dev_data[1] },
-       { PCI_VDEVICE(AMD, 0x14c3), (kernel_ulong_t)&dev_data[1] },
-       { PCI_VDEVICE(AMD, 0x155a), (kernel_ulong_t)&dev_data[1] },
-       { PCI_VDEVICE(AMD, 0x17d4), (kernel_ulong_t)&dev_data[1] },
-       { PCI_VDEVICE(AMD, 0x17d7), (kernel_ulong_t)&dev_data[2] },
-       { PCI_VDEVICE(HYGON, 0x145b), (kernel_ulong_t)&dev_data[0] },
-       { 0, }
+       { PCI_VDEVICE(AMD, 0x145b), .driver_data = (kernel_ulong_t)&dev_data[0] },
+       { PCI_VDEVICE(AMD, 0x148b), .driver_data = (kernel_ulong_t)&dev_data[1] },
+       { PCI_VDEVICE(AMD, 0x14c0), .driver_data = (kernel_ulong_t)&dev_data[1] },
+       { PCI_VDEVICE(AMD, 0x14c3), .driver_data = (kernel_ulong_t)&dev_data[1] },
+       { PCI_VDEVICE(AMD, 0x155a), .driver_data = (kernel_ulong_t)&dev_data[1] },
+       { PCI_VDEVICE(AMD, 0x17d4), .driver_data = (kernel_ulong_t)&dev_data[1] },
+       { PCI_VDEVICE(AMD, 0x17d7), .driver_data = (kernel_ulong_t)&dev_data[2] },
+       { PCI_VDEVICE(HYGON, 0x145b), .driver_data = (kernel_ulong_t)&dev_data[0] },
+       { }
 };
 MODULE_DEVICE_TABLE(pci, amd_ntb_pci_tbl);