Skip to content

Commit 87382ea

Browse files
arndbbjorn-helgaas
authored andcommitted
PCI/sysfs: Move declarations to linux/pci.h
A couple of architectures build the __weak versions of pci_create_resource_files() and pci_remove_resource_files() but don't have prototypes for these, which causes warnings: drivers/pci/pci-sysfs.c:1253:12: error: no previous prototype for 'pci_create_resource_files' [-Werror=missing-prototypes] 1253 | int __weak pci_create_resource_files(struct pci_dev *dev) { return 0; } drivers/pci/pci-sysfs.c:1254:13: error: no previous prototype for 'pci_remove_resource_files' [-Werror=missing-prototypes] 1254 | void __weak pci_remove_resource_files(struct pci_dev *dev) { return; } Move the prototypes from alpha architecture into the global header to avoid these warnings for all of them. Link: https://lore.kernel.org/r/20230810141947.1236730-5-arnd@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 0e8207f commit 87382ea

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

arch/alpha/include/asm/pci.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,4 @@ extern void pci_adjust_legacy_attr(struct pci_bus *bus,
8888
enum pci_mmap_state mmap_type);
8989
#define HAVE_PCI_LEGACY 1
9090

91-
extern int pci_create_resource_files(struct pci_dev *dev);
92-
extern void pci_remove_resource_files(struct pci_dev *dev);
93-
9491
#endif /* __ALPHA_PCI_H */

include/linux/pci.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,6 +2260,11 @@ int pcibios_alloc_irq(struct pci_dev *dev);
22602260
void pcibios_free_irq(struct pci_dev *dev);
22612261
resource_size_t pcibios_default_alignment(void);
22622262

2263+
#if !defined(HAVE_PCI_MMAP) && !defined(ARCH_GENERIC_PCI_MMAP_RESOURCE)
2264+
extern int pci_create_resource_files(struct pci_dev *dev);
2265+
extern void pci_remove_resource_files(struct pci_dev *dev);
2266+
#endif
2267+
22632268
#if defined(CONFIG_PCI_MMCONFIG) || defined(CONFIG_ACPI_MCFG)
22642269
void __init pci_mmcfg_early_init(void);
22652270
void __init pci_mmcfg_late_init(void);

0 commit comments

Comments
 (0)