Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Arnd Bergmann and committed by
Bjorn Helgaas
87382ead 0e8207f5

+5 -3
-3
arch/alpha/include/asm/pci.h
··· 88 88 enum pci_mmap_state mmap_type); 89 89 #define HAVE_PCI_LEGACY 1 90 90 91 - extern int pci_create_resource_files(struct pci_dev *dev); 92 - extern void pci_remove_resource_files(struct pci_dev *dev); 93 - 94 91 #endif /* __ALPHA_PCI_H */
+5
include/linux/pci.h
··· 2260 2260 void pcibios_free_irq(struct pci_dev *dev); 2261 2261 resource_size_t pcibios_default_alignment(void); 2262 2262 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 + 2263 2268 #if defined(CONFIG_PCI_MMCONFIG) || defined(CONFIG_ACPI_MCFG) 2264 2269 void __init pci_mmcfg_early_init(void); 2265 2270 void __init pci_mmcfg_late_init(void);