Skip to contentSkip to conversation

PCI: use array for .id_table consistently

PATCH Applied Masahiro Yamada 2 participants 2 messages May 17, 2024 – Jun 7, 2024

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: use array for .id_table consistently

While 'x' and '&x[0]' are equivalent, most of the PCI drivers use the former form for the .id_table.

Update some drivers and documentation for consistency.

---

 Documentation/PCI/pciebus-howto.rst                    | 2 +-
 Documentation/translations/zh_CN/PCI/pciebus-howto.rst | 2 +-
 drivers/pci/pcie/portdrv.c                             | 2 +-
 drivers/usb/cdns3/cdnsp-pci.c                          | 2 +-
 drivers/usb/gadget/udc/cdns2/cdns2-pci.c               | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
Documentation/PCI/pciebus-howto.rst +1 -1
index a0027e8fb0d0..f344452651e1 100644
@@ -139,7 +139,7 @@ driver data structure.
 
   static struct pcie_port_service_driver root_aerdrv = {
     .name		= (char *)device_name,
-    .id_table	= &service_id[0],
+    .id_table	= service_id,
 
     .probe		= aerdrv_load,
     .remove		= aerdrv_unload,
Documentation/translations/zh_CN/PCI/pciebus-howto.rst +1 -1
index 65c4301f12cd..c6ffda62af21 100644
@@ -124,7 +124,7 @@ pcie_port_service_unregister取代了Linux驱动模型的pci_unregister_driver
 
   static struct pcie_port_service_driver root_aerdrv = {
     .name		= (char *)device_name,
-    .id_table	= &service_id[0],
+    .id_table	= service_id,
 
     .probe		= aerdrv_load,
     .remove		= aerdrv_unload,
drivers/pci/pcie/portdrv.c +1 -1
index 14a4b89a3b83..2faca06ff67c 100644
@@ -786,7 +786,7 @@ static const struct pci_error_handlers pcie_portdrv_err_handler = {
 
 static struct pci_driver pcie_portdriver = {
 	.name		= "pcieport",
-	.id_table	= &port_pci_ids[0],
+	.id_table	= port_pci_ids,
 
 	.probe		= pcie_portdrv_probe,
 	.remove		= pcie_portdrv_remove,
drivers/usb/cdns3/cdnsp-pci.c +1 -1
index 0725668ffea4..225540fc81ba 100644
@@ -231,7 +231,7 @@ static const struct pci_device_id cdnsp_pci_ids[] = {
 
 static struct pci_driver cdnsp_pci_driver = {
 	.name = "cdnsp-pci",
-	.id_table = &cdnsp_pci_ids[0],
+	.id_table = cdnsp_pci_ids,
 	.probe = cdnsp_pci_probe,
 	.remove = cdnsp_pci_remove,
 	.driver = {
drivers/usb/gadget/udc/cdns2/cdns2-pci.c +1 -1
index 1691541c9413..50c3d0974d9b 100644
@@ -121,7 +121,7 @@ static const struct pci_device_id cdns2_pci_ids[] = {
 
 static struct pci_driver cdns2_pci_driver = {
 	.name = "cdns2-pci",
-	.id_table = &cdns2_pci_ids[0],
+	.id_table = cdns2_pci_ids,
 	.probe = cdns2_pci_probe,
 	.remove = cdns2_pci_remove,
 	.driver = {
Signature · 1 line
2.40.1
#1 lore raw
Quoted 6 lines · Masahiro Yamada

While 'x' and '&x[0]' are equivalent, most of the PCI drivers use the former form for the .id_table.

Update some drivers and documentation for consistency.

Applied to pci/misc for v6.11, thanks!

USB folks, let me know if you'd rather that I drop your parts.

Quoted 77 lines

---

 Documentation/PCI/pciebus-howto.rst                    | 2 +-
 Documentation/translations/zh_CN/PCI/pciebus-howto.rst | 2 +-
 drivers/pci/pcie/portdrv.c                             | 2 +-
 drivers/usb/cdns3/cdnsp-pci.c                          | 2 +-
 drivers/usb/gadget/udc/cdns2/cdns2-pci.c               | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
Documentation/PCI/pciebus-howto.rst +1 -1
index a0027e8fb0d0..f344452651e1 100644
@@ -139,7 +139,7 @@ driver data structure.
 
   static struct pcie_port_service_driver root_aerdrv = {
     .name		= (char *)device_name,
-    .id_table	= &service_id[0],
+    .id_table	= service_id,
 
     .probe		= aerdrv_load,
     .remove		= aerdrv_unload,
Documentation/translations/zh_CN/PCI/pciebus-howto.rst +1 -1
index 65c4301f12cd..c6ffda62af21 100644
@@ -124,7 +124,7 @@ pcie_port_service_unregister取代了Linux驱动模型的pci_unregister_driver
 
   static struct pcie_port_service_driver root_aerdrv = {
     .name		= (char *)device_name,
-    .id_table	= &service_id[0],
+    .id_table	= service_id,
 
     .probe		= aerdrv_load,
     .remove		= aerdrv_unload,
drivers/pci/pcie/portdrv.c +1 -1
index 14a4b89a3b83..2faca06ff67c 100644
@@ -786,7 +786,7 @@ static const struct pci_error_handlers pcie_portdrv_err_handler = {
 
 static struct pci_driver pcie_portdriver = {
 	.name		= "pcieport",
-	.id_table	= &port_pci_ids[0],
+	.id_table	= port_pci_ids,
 
 	.probe		= pcie_portdrv_probe,
 	.remove		= pcie_portdrv_remove,
drivers/usb/cdns3/cdnsp-pci.c +1 -1
index 0725668ffea4..225540fc81ba 100644
@@ -231,7 +231,7 @@ static const struct pci_device_id cdnsp_pci_ids[] = {
 
 static struct pci_driver cdnsp_pci_driver = {
 	.name = "cdnsp-pci",
-	.id_table = &cdnsp_pci_ids[0],
+	.id_table = cdnsp_pci_ids,
 	.probe = cdnsp_pci_probe,
 	.remove = cdnsp_pci_remove,
 	.driver = {
drivers/usb/gadget/udc/cdns2/cdns2-pci.c +1 -1
index 1691541c9413..50c3d0974d9b 100644
@@ -121,7 +121,7 @@ static const struct pci_device_id cdns2_pci_ids[] = {
 
 static struct pci_driver cdns2_pci_driver = {
 	.name = "cdns2-pci",
-	.id_table = &cdns2_pci_ids[0],
+	.id_table = cdns2_pci_ids,
 	.probe = cdns2_pci_probe,
 	.remove = cdns2_pci_remove,
 	.driver = {
Signature · 1 line
2.40.1