lib: devres: Fix misplaced #endif
PATCH 1/1 lib: devres: Fix misplaced #endif
A misplaced #endif causes link errors related to pcim_*() functions.
--- lib/devres.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
lib/devres.c +1 -1
@@ -227,6 +227,7 @@ void devm_ioport_unmap(struct device *dev, void __iomem *addr) devm_ioport_map_match, (void *)addr)); }EXPORT_SYMBOL (devm_ioport_unmap); +#endif /* CONFIG_HAS_IOPORT */ #ifdef CONFIG_PCI /*
@@ -432,4 +433,3 @@ void pcim_iounmap_regions(struct pci_dev *pdev, int mask) }EXPORT_SYMBOL (pcim_iounmap_regions);#endif /* CONFIG_PCI */ -#endif /* CONFIG_HAS_IOPORT */
Signature · 1 line
1.7.2.5
Andrew Morton
maintainerQuoted 13 lines · On Fri, 22 Feb 2013 14:39:40 +0900 Jingoo Han <[email protected]> wrote:
A misplaced #endif causes link errors related to pcim_*() functions.
lib/devres.c +1
-0@@ -227,6 +227,7 @@ void devm_ioport_unmap(struct device *dev, void __iomem *addr) devm_ioport_map_match, (void *)addr)); }EXPORT_SYMBOL (devm_ioport_unmap); +#endif /* CONFIG_HAS_IOPORT */ #ifdef CONFIG_PCI /*
lib/devres.c void pcim_iounmap_regions(struct pci_dev *pdev, int mask) · line 435
Quoted 4 lines
lib/devres.c +0
-1@@ -432,4 +433,3 @@ void pcim_iounmap_regions(struct pci_dev *pdev, int mask) }EXPORT_SYMBOL (pcim_iounmap_regions);#endif /* CONFIG_PCI */ -#endif /* CONFIG_HAS_IOPORT */
More details needed, please. This code is pretty old and it's surprising that errors are popping up now.
Quoted 14 lines · Andrew Morton
Quoted 10 lines · On Fri, 22 Feb 2013 14:39:40 +0900 Jingoo Han <[email protected]> wrote:
A misplaced #endif causes link errors related to pcim_*() functions.
lib/devres.c +1
-0@@ -227,6 +227,7 @@ void devm_ioport_unmap(struct device *dev, void __iomem *addr) devm_ioport_map_match, (void *)addr)); }EXPORT_SYMBOL (devm_ioport_unmap); +#endif /* CONFIG_HAS_IOPORT */
Quoted 10 lines
lib/devres.c void pcim_iounmap_regions(struct pci_dev *pdev, int mask) · line 435
Quoted 7 lines
lib/devres.c +0
-1#ifdef CONFIG_PCI /* @@ -432,4 +433,3 @@ void pcim_iounmap_regions(struct pci_dev *pdev, int mask) }EXPORT_SYMBOL (pcim_iounmap_regions);#endif /* CONFIG_PCI */ -#endif /* CONFIG_HAS_IOPORT */ More details needed, please. This code is pretty old and it's surprising that errors are popping up now.
OK, I will add more detailed commit message.
Thank you.
Best regards,
Jingoo Han
PATCH v2 1/1 lib: devres: Fix misplaced #endif
In reply to Jingoo HanA misplaced #endif causes link errors related to pcim_*() functions.
This is because pcim_*() functions are related to CONFIG_PCI option, however these are not related to CONFIG_HAS_IOPORT option. Therefore, when CONFIG_PCI is enabled and CONFIG_HAS_IOPORT is not enabled, it makes link errors related to pcim_*() functions as below:
drivers/ata/libata-sff.c:3233: undefined reference to pcim_iomap_regions' drivers/ata/libata-sff.c:3238: undefined reference to pcim_iomap_table' drivers/built-in.o: In function `ata_pci_sff_init_host':drivers/ata/libata-sff.c:2318: undefined reference to pcim_iomap_regions' drivers/ata/libata-sff.c:2329: undefined reference to pcim_iomap_table
---
Changes since v1:
- Added more detailed commit message
lib/devres.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
lib/devres.c +1 -1
@@ -227,6 +227,7 @@ void devm_ioport_unmap(struct device *dev, void __iomem *addr) devm_ioport_map_match, (void *)addr)); }EXPORT_SYMBOL (devm_ioport_unmap); +#endif /* CONFIG_HAS_IOPORT */ #ifdef CONFIG_PCI /*
@@ -432,4 +433,3 @@ void pcim_iounmap_regions(struct pci_dev *pdev, int mask) }EXPORT_SYMBOL (pcim_iounmap_regions);#endif /* CONFIG_PCI */ -#endif /* CONFIG_HAS_IOPORT */
Signature · 1 line
1.7.2.5