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

powerpc: address missing-prototypes warnings

There are a few warnings in powerpc64 defconfig builds after -Wmissing-prototypes
gets promoted from W=1 to the default warning set:

arch/powerpc/mm/book3s64/pgtable.c:422:6: error: no previous prototype for 'arch_report_meminfo' [-Werror=missing-prototypes]
arch/powerpc/platforms/cell/ras.c:275:5: error: no previous prototype for 'cbe_sysreset_hack' [-Werror=missing-prototypes]
arch/powerpc/platforms/cell/spu_manage.c:29:21: error: no previous prototype for 'spu_devnode' [-Werror=missing-prototypes]
arch/powerpc/platforms/pasemi/time.c:12:17: error: no previous prototype for 'pas_get_boot_time' [-Werror=missing-prototypes]
arch/powerpc/platforms/powermac/feature.c:1532:13: error: no previous prototype for 'g5_phy_disable_cpu1' [-Werror=missing-prototypes]
arch/powerpc/platforms/86xx/pic.c:28:13: error: no previous prototype for 'mpc86xx_init_irq' [-Werror=missing-prototypes]
drivers/pci/pci-sysfs.c:936:13: error: no previous prototype for 'pci_adjust_legacy_attr' [-Werror=missing-prototypes]

Address these by including the right header files or marking the
functions static. The audit.c one is a bit tricky since compat_audit.h
cannot include regular kernel headers tht have conflicting types on
32-bit powerpc.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[mpe: Drop change to __vmemmap_free() which only exists in mm]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230727122720.2558065-1-arnd@kernel.org

authored by

Arnd Bergmann and committed by
Michael Ellerman
54f30b83 c3062ede

+23 -3
+2 -1
arch/powerpc/include/asm/pci.h
··· 82 82 extern int pci_mmap_legacy_page_range(struct pci_bus *bus, 83 83 struct vm_area_struct *vma, 84 84 enum pci_mmap_state mmap_state); 85 - 85 + extern void pci_adjust_legacy_attr(struct pci_bus *bus, 86 + enum pci_mmap_state mmap_type); 86 87 #define HAVE_PCI_LEGACY 1 87 88 88 89 extern void pcibios_claim_one_bus(struct pci_bus *b);
+2 -1
arch/powerpc/kernel/audit.c
··· 4 4 #include <linux/audit.h> 5 5 #include <asm/unistd.h> 6 6 7 + #include "audit_32.h" 8 + 7 9 static unsigned dir_class[] = { 8 10 #include <asm-generic/audit_dir_write.h> 9 11 ~0U ··· 43 41 int audit_classify_syscall(int abi, unsigned syscall) 44 42 { 45 43 #ifdef CONFIG_PPC64 46 - extern int ppc32_classify_syscall(unsigned); 47 44 if (abi == AUDIT_ARCH_PPC) 48 45 return ppc32_classify_syscall(syscall); 49 46 #endif
+7
arch/powerpc/kernel/audit_32.h
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #ifndef __AUDIT_32_H__ 3 + #define __AUDIT_32_H__ 4 + 5 + extern int ppc32_classify_syscall(unsigned); 6 + 7 + #endif
+2
arch/powerpc/kernel/compat_audit.c
··· 3 3 #include <linux/audit_arch.h> 4 4 #include <asm/unistd.h> 5 5 6 + #include "audit_32.h" 7 + 6 8 unsigned ppc32_dir_class[] = { 7 9 #include <asm-generic/audit_dir_write.h> 8 10 ~0U
+1
arch/powerpc/mm/book3s64/pgtable.c
··· 9 9 #include <linux/memremap.h> 10 10 #include <linux/pkeys.h> 11 11 #include <linux/debugfs.h> 12 + #include <linux/proc_fs.h> 12 13 #include <misc/cxl-base.h> 13 14 14 15 #include <asm/pgalloc.h>
+2
arch/powerpc/platforms/86xx/pic.c
··· 12 12 #include <asm/mpic.h> 13 13 #include <asm/i8259.h> 14 14 15 + #include "mpc86xx.h" 16 + 15 17 #ifdef CONFIG_PPC_I8259 16 18 static void mpc86xx_8259_cascade(struct irq_desc *desc) 17 19 {
+1 -1
arch/powerpc/platforms/cell/ras.c
··· 22 22 #include <asm/cell-regs.h> 23 23 24 24 #include "ras.h" 25 - 25 + #include "pervasive.h" 26 26 27 27 static void dump_fir(int cpu) 28 28 {
+1
arch/powerpc/platforms/cell/spu_manage.c
··· 25 25 26 26 #include "spufs/spufs.h" 27 27 #include "interrupt.h" 28 + #include "spu_priv1_mmio.h" 28 29 29 30 struct device_node *spu_devnode(struct spu *spu) 30 31 {
+1
arch/powerpc/platforms/pasemi/pasemi.h
··· 4 4 5 5 extern time64_t pas_get_boot_time(void); 6 6 extern void pas_pci_init(void); 7 + struct pci_dev; 7 8 extern void pas_pci_irq_fixup(struct pci_dev *dev); 8 9 extern void pas_pci_dma_dev_setup(struct pci_dev *dev); 9 10
+2
arch/powerpc/platforms/pasemi/time.c
··· 9 9 10 10 #include <asm/time.h> 11 11 12 + #include "pasemi.h" 13 + 12 14 time64_t __init pas_get_boot_time(void) 13 15 { 14 16 /* Let's just return a fake date right now */
+2
arch/powerpc/platforms/powermac/feature.c
··· 37 37 #include <asm/pci-bridge.h> 38 38 #include <asm/pmac_low_i2c.h> 39 39 40 + #include "pmac.h" 41 + 40 42 #undef DEBUG_FEATURE 41 43 42 44 #ifdef DEBUG_FEATURE