Skip to contentSkip to conversation

PCI: generic: stop hiding pci_host_common_probe declaration

PATCH In review Arnd Bergmann 4 participants 4 messages Mar 21, 2017 – Apr 4, 2017 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: generic: stop hiding pci_host_common_probe declaration

When pci_host_common_probe() was moved into a separate module, the #ifdef around the declaration was left in the header file, which can lead to build errors in some configurations:

drivers/pci/host/pci-thunder-pem.c: In function 'thunder_pem_probe':
drivers/pci/host/pci-thunder-pem.c:412:9: error: implicit declaration of function 'pci_host_common_probe';did you mean 'pci_host_bridge_priv'? [-Werror=implicit-function-declaration]

The ifdef serves no real purpose anyway, so we can just remove it.

Fixes 4e64dbe226e7 ("PCI: generic: Expose pci_host_common_probe() for use by other drivers")
---
 include/linux/pci-ecam.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/pci-ecam.h +0 -2
index f0d2b9451270..92a73847e1d3 100644
@@ -68,9 +68,7 @@ extern struct pci_ecam_ops xgene_v1_pcie_ecam_ops; /* APM X-Gene PCIe v1 */
 extern struct pci_ecam_ops xgene_v2_pcie_ecam_ops; /* APM X-Gene PCIe v2.x */
 #endif
 
-#ifdef CONFIG_PCI_HOST_GENERIC
 /* for DT-based PCI controllers that support ECAM */
 int pci_host_common_probe(struct platform_device *pdev,
 			  struct pci_ecam_ops *ops);
 #endif
-#endif
Signature · 1 line
2.9.0
Reviewed-by Tested-by on v1 1/1
#1 lore raw

Hi Arnd,

Quoted 21 lines · Arnd Bergmann

When pci_host_common_probe() was moved into a separate module, the #ifdef around the declaration was left in the header file, which can lead to build errors in some configurations:

drivers/pci/host/pci-thunder-pem.c: In function 'thunder_pem_probe':
drivers/pci/host/pci-thunder-pem.c:412:9: error: implicit declaration of function 'pci_host_common_probe';did you mean 'pci_host_bridge_priv'? [-Werror=implicit-function-declaration]

The ifdef serves no real purpose anyway, so we can just remove it.

Fixes 4e64dbe226e7 ("PCI: generic: Expose pci_host_common_probe() for use by other drivers")
---
 include/linux/pci-ecam.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/pci-ecam.h +0 -0
index f0d2b9451270..92a73847e1d3 100644

include/linux/pci-ecam.h extern struct pci_ecam_ops xgene_v1_pcie_ecam_ops; /* APM X-Gene PCIe v1 */ · line 76

Quoted 9 lines
include/linux/pci-ecam.h +0 -2
@@ -68,9 +68,7 @@ extern struct pci_ecam_ops xgene_v1_pcie_ecam_ops; /* APM X-Gene PCIe v1 */
 extern struct pci_ecam_ops xgene_v2_pcie_ecam_ops; /* APM X-Gene PCIe v2.x */
 #endif
 
-#ifdef CONFIG_PCI_HOST_GENERIC
 /* for DT-based PCI controllers that support ECAM */
 int pci_host_common_probe(struct platform_device *pdev,
 			  struct pci_ecam_ops *ops);
 #endif
-#endif

Thanks for fixing this.

Tomasz

#2 lore raw
In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

When pci_host_common_probe() was moved into a separate module, the #ifdef around the declaration was left in the header file, which can lead to build errors in some configurations:

drivers/pci/host/pci-thunder-pem.c: In function 'thunder_pem_probe':
drivers/pci/host/pci-thunder-pem.c:412:9: error: implicit declaration of function 'pci_host_common_probe';did you mean 'pci_host_bridge_priv'? [-Werror=implicit-function-declaration]

The ifdef serves no real purpose anyway, so we can just remove it.

Fixes 4e64dbe226e7 ("PCI: generic: Expose pci_host_common_probe() for use by other drivers")

It looks like 4e64dbe226e7 was merged for v4.6-rc1. Does that mean this build error has been there that long? Is there another, more recent commit that actually broke this?

I suspect something broke in the v4.11 merge window, so I'm fishing for a commit from that window so I can include this for v4.11.

Quoted 22 lines
---
 include/linux/pci-ecam.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/pci-ecam.h +0 -2
index f0d2b9451270..92a73847e1d3 100644
@@ -68,9 +68,7 @@ extern struct pci_ecam_ops xgene_v1_pcie_ecam_ops; /* APM X-Gene PCIe v1 */
 extern struct pci_ecam_ops xgene_v2_pcie_ecam_ops; /* APM X-Gene PCIe v2.x */
 #endif
 
-#ifdef CONFIG_PCI_HOST_GENERIC
 /* for DT-based PCI controllers that support ECAM */
 int pci_host_common_probe(struct platform_device *pdev,
 			  struct pci_ecam_ops *ops);
 #endif
-#endif
Signature · 1 line
2.9.0
#3 lore raw
In reply to Arnd Bergmann
Quoted 21 lines · Arnd Bergmann

When pci_host_common_probe() was moved into a separate module, the #ifdef around the declaration was left in the header file, which can lead to build errors in some configurations:

drivers/pci/host/pci-thunder-pem.c: In function 'thunder_pem_probe':
drivers/pci/host/pci-thunder-pem.c:412:9: error: implicit declaration of function 'pci_host_common_probe';did you mean 'pci_host_bridge_priv'? [-Werror=implicit-function-declaration]

The ifdef serves no real purpose anyway, so we can just remove it.

Fixes 4e64dbe226e7 ("PCI: generic: Expose pci_host_common_probe() for use by other drivers")
---
 include/linux/pci-ecam.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/pci-ecam.h +0 -0
index f0d2b9451270..92a73847e1d3 100644

include/linux/pci-ecam.h extern struct pci_ecam_ops xgene_v1_pcie_ecam_ops; /* APM X-Gene PCIe v1 */ · line 76

Quoted 9 lines
include/linux/pci-ecam.h +0 -2
@@ -68,9 +68,7 @@ extern struct pci_ecam_ops xgene_v1_pcie_ecam_ops; /* APM X-Gene PCIe v1 */
 extern struct pci_ecam_ops xgene_v2_pcie_ecam_ops; /* APM X-Gene PCIe v2.x */
 #endif
 
-#ifdef CONFIG_PCI_HOST_GENERIC
 /* for DT-based PCI controllers that support ECAM */
 int pci_host_common_probe(struct platform_device *pdev,
 			  struct pci_ecam_ops *ops);
 #endif
-#endif

I ran into this issue as well (on v4.9) and submitted a patch a week after you did, by pure coincidence:

Subject: [TRIVIAL PATCH] PCI: Change pci_host_common_probe visibility
Date: Tue, 28 Mar 2017 17:29:51 +0200
https://www.spinics.net/lists/linux-pci/msg59823.html

Regards.