linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: use array for .id_table consistently
@ 2024-05-17 12:04 Masahiro Yamada
  2024-06-07 19:47 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2024-05-17 12:04 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci
  Cc: linux-kernel, Masahiro Yamada, Alex Shi, Greg Kroah-Hartman,
	Jonathan Corbet, Pawel Laszczak, Yanteng Si, linux-doc, linux-usb

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.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 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(-)

diff --git a/Documentation/PCI/pciebus-howto.rst b/Documentation/PCI/pciebus-howto.rst
index a0027e8fb0d0..f344452651e1 100644
--- a/Documentation/PCI/pciebus-howto.rst
+++ b/Documentation/PCI/pciebus-howto.rst
@@ -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,
diff --git a/Documentation/translations/zh_CN/PCI/pciebus-howto.rst b/Documentation/translations/zh_CN/PCI/pciebus-howto.rst
index 65c4301f12cd..c6ffda62af21 100644
--- a/Documentation/translations/zh_CN/PCI/pciebus-howto.rst
+++ b/Documentation/translations/zh_CN/PCI/pciebus-howto.rst
@@ -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,
diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c
index 14a4b89a3b83..2faca06ff67c 100644
--- a/drivers/pci/pcie/portdrv.c
+++ b/drivers/pci/pcie/portdrv.c
@@ -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,
diff --git a/drivers/usb/cdns3/cdnsp-pci.c b/drivers/usb/cdns3/cdnsp-pci.c
index 0725668ffea4..225540fc81ba 100644
--- a/drivers/usb/cdns3/cdnsp-pci.c
+++ b/drivers/usb/cdns3/cdnsp-pci.c
@@ -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 = {
diff --git a/drivers/usb/gadget/udc/cdns2/cdns2-pci.c b/drivers/usb/gadget/udc/cdns2/cdns2-pci.c
index 1691541c9413..50c3d0974d9b 100644
--- a/drivers/usb/gadget/udc/cdns2/cdns2-pci.c
+++ b/drivers/usb/gadget/udc/cdns2/cdns2-pci.c
@@ -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 = {
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: use array for .id_table consistently
  2024-05-17 12:04 [PATCH] PCI: use array for .id_table consistently Masahiro Yamada
@ 2024-06-07 19:47 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2024-06-07 19:47 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Bjorn Helgaas, linux-pci, linux-kernel, Alex Shi,
	Greg Kroah-Hartman, Jonathan Corbet, Pawel Laszczak, Yanteng Si,
	linux-doc, linux-usb

On Fri, May 17, 2024 at 09:04:58PM +0900, Masahiro Yamada wrote:
> 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.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

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

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

> ---
> 
>  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(-)
> 
> diff --git a/Documentation/PCI/pciebus-howto.rst b/Documentation/PCI/pciebus-howto.rst
> index a0027e8fb0d0..f344452651e1 100644
> --- a/Documentation/PCI/pciebus-howto.rst
> +++ b/Documentation/PCI/pciebus-howto.rst
> @@ -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,
> diff --git a/Documentation/translations/zh_CN/PCI/pciebus-howto.rst b/Documentation/translations/zh_CN/PCI/pciebus-howto.rst
> index 65c4301f12cd..c6ffda62af21 100644
> --- a/Documentation/translations/zh_CN/PCI/pciebus-howto.rst
> +++ b/Documentation/translations/zh_CN/PCI/pciebus-howto.rst
> @@ -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,
> diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c
> index 14a4b89a3b83..2faca06ff67c 100644
> --- a/drivers/pci/pcie/portdrv.c
> +++ b/drivers/pci/pcie/portdrv.c
> @@ -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,
> diff --git a/drivers/usb/cdns3/cdnsp-pci.c b/drivers/usb/cdns3/cdnsp-pci.c
> index 0725668ffea4..225540fc81ba 100644
> --- a/drivers/usb/cdns3/cdnsp-pci.c
> +++ b/drivers/usb/cdns3/cdnsp-pci.c
> @@ -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 = {
> diff --git a/drivers/usb/gadget/udc/cdns2/cdns2-pci.c b/drivers/usb/gadget/udc/cdns2/cdns2-pci.c
> index 1691541c9413..50c3d0974d9b 100644
> --- a/drivers/usb/gadget/udc/cdns2/cdns2-pci.c
> +++ b/drivers/usb/gadget/udc/cdns2/cdns2-pci.c
> @@ -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 = {
> -- 
> 2.40.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-07 19:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-17 12:04 [PATCH] PCI: use array for .id_table consistently Masahiro Yamada
2024-06-07 19:47 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).