mips: address -Wmissing-prototypes warnings
Subsystems (3)
cover mips: address -Wmissing-prototypes warnings
From: Arnd Bergmann <[email protected]>
As promised, I've now addressed the -Wmissing-prototypes warnings that showed up in mips as the last major architecture after my patch to enable the option everywhere.
This should result in a clean build for the defconfig and allmodconfig builds, but the older platforms that are not yet converted to CONFFIG_MIPS_GENERIC_KERNEL tend to still have some remaining warnings in platform specific code that someone needs to address.
The patches could either go through Thomas's mips tree, or alternatively through linux-mm along with the hexagon patches that Andrew has already merged.
Arnd
Arnd Bergmann (20):
mips: decompress: fix add missing prototypes
mips: add asm/syscalls.h header
mips: add missing declarations for trap handlers
mips: rs870e: stop exporting local functions
mips: signal: move sigcontext declarations to header
mips: mark local function static if possible
mips: move build_tlb_refill_handler() prototype
mips: move jump_label_apply_nops() declaration to header
mips: unhide uasm_in_compat_space_p() declaration
mips: fix setup_zero_pages() prototype
mips: fix tlb_init() prototype
mips: move cache declarations into header
mips: add missing declarations
mips: spram: fix missing prototype warning for spram_config
mips: mt: include asm/mips_mt.h
mips: remove extraneous asm-generic/iomap.h include
mips: suspend: include linux/suspend.h as needed
mips: hide conditionally unused functions
mips: smp: fix setup_profiling_timer() prototype
mips: kexec: include linux/reboot.h
arch/mips/boot/compressed/dbg.c | 2 ++ arch/mips/boot/compressed/decompress.c | 16 ++------- arch/mips/boot/compressed/decompress.h | 24 ++++++++++++++ arch/mips/boot/compressed/string.c | 1 + arch/mips/include/asm/cache.h | 6 ++++ arch/mips/include/asm/io.h | 2 -- arch/mips/include/asm/jump_label.h | 3 ++ .../mips/include/asm/mach-loongson64/mmzone.h | 1 - arch/mips/include/asm/mmzone.h | 2 ++ arch/mips/include/asm/processor.h | 2 ++ arch/mips/include/asm/r4kcache.h | 4 +++ arch/mips/include/asm/setup.h | 1 + arch/mips/include/asm/signal.h | 1 + arch/mips/include/asm/smp.h | 2 ++ arch/mips/include/asm/spram.h | 2 +- arch/mips/include/asm/syscalls.h | 33 +++++++++++++++++++ arch/mips/include/asm/tlbex.h | 1 + arch/mips/include/asm/traps.h | 23 +++++++++++++ arch/mips/include/asm/uasm.h | 2 -- arch/mips/kernel/cpu-probe.c | 1 - arch/mips/kernel/cpu-r3k-probe.c | 1 - arch/mips/kernel/linux32.c | 1 + arch/mips/kernel/machine_kexec.c | 1 + arch/mips/kernel/mips-cm.c | 2 +- arch/mips/kernel/mips-mt-fpaff.c | 1 + arch/mips/kernel/mips-mt.c | 1 + arch/mips/kernel/module.c | 3 +- arch/mips/kernel/r4k-bugs64.c | 1 + arch/mips/kernel/signal-common.h | 3 ++ arch/mips/kernel/signal.c | 1 + arch/mips/kernel/signal32.c | 1 + arch/mips/kernel/signal_n32.c | 4 +-- arch/mips/kernel/signal_o32.c | 1 + arch/mips/kernel/smp.c | 3 ++ arch/mips/kernel/spram.c | 1 + arch/mips/kernel/syscall.c | 1 + arch/mips/kernel/traps.c | 2 -- arch/mips/kernel/unaligned.c | 1 + arch/mips/mm/c-r4k.c | 6 +--- arch/mips/mm/cache.c | 6 ---- arch/mips/mm/fault.c | 1 + arch/mips/mm/init.c | 1 + arch/mips/mm/pgtable-64.c | 2 ++ arch/mips/mm/tlb-r3k.c | 4 +-- arch/mips/mm/tlb-r4k.c | 6 ++-- arch/mips/power/cpu.c | 1 + arch/mips/power/hibernate.c | 1 + drivers/platform/mips/rs780e-acpi.c | 12 +++---- 48 files changed, 145 insertions(+), 53 deletions(-) create mode 100644 arch/mips/boot/compressed/decompress.h create mode 100644 arch/mips/include/asm/syscalls.h
Signature · 1 line
2.39.2
PATCH 1/20 mips: decompress: fix add missing prototypes
From: Arnd Bergmann <[email protected]>
The mips decompressor has some string functions defined locally that are not declared in the right place:
arch/mips/boot/compressed/dbg.c:12:13: error: no previous prototype for 'putc' [-Werror=missing-prototypes] arch/mips/boot/compressed/dbg.c:16:6: error: no previous prototype for 'puts' [-Werror=missing-prototypes] arch/mips/boot/compressed/dbg.c:26:6: error: no previous prototype for 'puthex' [-Werror=missing-prototypes] arch/mips/boot/compressed/string.c:11:7: error: no previous prototype for 'memcpy' [-Werror=missing-prototypes] arch/mips/boot/compressed/string.c:22:7: error: no previous prototype for 'memset' [-Werror=missing-prototypes] arch/mips/boot/compressed/string.c:32:15: error: no previous prototype for 'memmove' [-Werror=missing-prototypes] arch/mips/boot/compressed/decompress.c:43:6: error: no previous prototype for 'error' [-Werror=missing-prototypes] arch/mips/boot/compressed/decompress.c:91:6: error: no previous prototype for 'decompress_kernel' [-Werror=missing-prototypes]
Include the string.h header where needed and add a decompress.h header to have shared prototypes for the rest.
--- arch/mips/boot/compressed/dbg.c | 2 ++ arch/mips/boot/compressed/decompress.c | 16 ++-------------- arch/mips/boot/compressed/decompress.h | 24 ++++++++++++++++++++++++ arch/mips/boot/compressed/string.c | 1 + 4 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 arch/mips/boot/compressed/decompress.h
arch/mips/boot/compressed/dbg.c +2 -0
@@ -9,6 +9,8 @@#include <linux/compiler.h> #include <linux/types.h> +#include "decompress.h" +void __weak putc (char c) { }
arch/mips/boot/compressed/decompress.c +2 -14
@@ -19,6 +19,8 @@#include <asm/unaligned.h> #include <asm-generic/vmlinux.lds.h> +#include "decompress.h" +/* * These two variables specify the free mem region * that can be used for temporary malloc area
@@ -26,20 +28,6 @@unsigned long free_mem_ptr;unsigned long free_mem_end_ptr; -/* The linker tells us where the image is. */ -extern unsigned char __image_begin[], __image_end[]; - -/* debug interfaces */ -#ifdef CONFIG_DEBUG_ZBOOT -extern void puts (const char *s); -extern void puthex (unsigned long long val); -#else -#define puts (s) do {} while (0) -#define puthex (val) do {} while (0) -#endif - -extern char __appended_dtb[]; -void error (char *x) {puts ("\n\n" );
arch/mips/boot/compressed/decompress.h new file +24 -0
@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef _DECOMPRESSOR_H +#define _DECOMPRESSOR_H + +/* The linker tells us where the image is. */ +extern unsigned char __image_begin[], __image_end[]; + +/* debug interfaces */ +#ifdef CONFIG_DEBUG_ZBOOT +extern void putc (char c); +extern void puts (const char *s); +extern void puthex (unsigned long long val); +#else +#define putc (s) do {} while (0) +#define puts (s) do {} while (0) +#define puthex (val) do {} while (0) +#endif + +extern char __appended_dtb[]; + +void error (char *x); +void decompress_kernel (unsigned long boot_heap_start); + +#endif
arch/mips/boot/compressed/string.c +1 -0
@@ -7,6 +7,7 @@#include <linux/compiler_attributes.h> #include <linux/types.h> +#include <asm/string.h> void *memcpy (void *dest,const void *src,size_t n) {
Signature · 1 line
2.39.2
PATCH 2/20 mips: add asm/syscalls.h header
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
System call prototypes are generally in linux/syscalls.h, but there are a couple of mips specific entry points that are missing there:
arch/mips/kernel/signal.c:636:17: error: no previous prototype for 'sys_sigreturn' [-Werror=missing-prototypes] arch/mips/kernel/signal.c:673:17: error: no previous prototype for 'sys_rt_sigreturn' [-Werror=missing-prototypes] arch/mips/kernel/syscall.c:51:16: error: no previous prototype for 'sysm_pipe' [-Werror=missing-prototypes] arch/mips/kernel/mips-mt-fpaff.c:65:17: error: no previous prototype for 'mipsmt_sys_sched_setaffinity' [-Werror=missing-prototypes] arch/mips/kernel/mips-mt-fpaff.c:157:17: error: no previous prototype for 'mipsmt_sys_sched_getaffinity' [-Werror=missing-prototypes]
Add these to a new asm/syscalls.h as we have in other architectures.
--- arch/mips/include/asm/syscalls.h | 33 ++++++++++++++++++++++++++++++++ arch/mips/kernel/linux32.c | 1 + arch/mips/kernel/mips-mt-fpaff.c | 1 + arch/mips/kernel/signal.c | 1 + arch/mips/kernel/signal32.c | 1 + arch/mips/kernel/signal_n32.c | 1 + arch/mips/kernel/signal_o32.c | 1 + arch/mips/kernel/syscall.c | 1 + 8 files changed, 40 insertions(+) create mode 100644 arch/mips/include/asm/syscalls.h
arch/mips/include/asm/syscalls.h new file +33 -0
@@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef _ASM_MIPS_SYSCALLS_H +#define _ASM_MIPS_SYSCALLS_H + +#include <linux/linkage.h> +#include <linux/compat.h> + +asmlinkage void sys_sigreturn(void); +asmlinkage void sys_rt_sigreturn(void); +asmlinkage int sysm_pipe(void); +asmlinkage long mipsmt_sys_sched_setaffinity (pid_t pid,unsigned int len, +unsigned long __user *user_mask_ptr); +asmlinkage long mipsmt_sys_sched_getaffinity (pid_t pid,unsigned int len, +unsigned long __user *user_mask_ptr); +asmlinkage long sys32_fallocate (int fd,int mode,unsigned offset_a2, +unsigned offset_a3,unsigned len_a4, +unsigned len_a5); +asmlinkage long sys32_fadvise64_64 (int fd,int __pad, +unsigned long a2,unsigned long a3, +unsigned long a4,unsigned long a5, +int flags); +asmlinkage ssize_t sys32_readahead(int fd, u32 pad0, u64 a2, u64 a3, +size_t count); +asmlinkage long sys32_sync_file_range (int fd,int __pad, +unsigned long a2,unsigned long a3, +unsigned long a4,unsigned long a5, +int flags); +asmlinkage void sys32_rt_sigreturn(void); +asmlinkage void sys32_sigreturn(void); +asmlinkage int sys32_sigsuspend(compat_sigset_t __user *uset); +asmlinkage void sysn32_rt_sigreturn(void); + +#endif
arch/mips/kernel/linux32.c +1 -0
@@ -42,6 +42,7 @@#include <linux/uaccess.h> #include <asm/mmu_context.h> #include <asm/mman.h> +#include <asm/syscalls.h> #ifdef __MIPSEB__#define merge_64 (r1, r2) ((((r1) & 0xffffffffUL) << 32) + ((r2) & 0xffffffffUL))
arch/mips/kernel/mips-mt-fpaff.c +1 -0
@@ -15,6 +15,7 @@#include <linux/security.h> #include <linux/types.h> #include <linux/uaccess.h> +#include <asm/syscalls.h> /* * CPU mask used to set process affinity for MT VPEs/TCs with FPUs
arch/mips/kernel/signal.c +1 -0
@@ -38,6 +38,7 @@#include <asm/dsp.h> #include <asm/inst.h> #include <asm/msa.h> +#include <asm/syscalls.h> #include "signal-common.h"
arch/mips/kernel/signal32.c +1 -0
@@ -18,6 +18,7 @@#include <asm/compat-signal.h> #include <linux/uaccess.h> #include <asm/unistd.h> +#include <asm/syscalls.h> #include "signal-common.h"
arch/mips/kernel/signal_n32.c +1 -0
@@ -24,6 +24,7 @@#include <asm/ucontext.h> #include <asm/fpu.h> #include <asm/cpu-features.h> +#include <asm/syscalls.h> #include "signal-common.h"
arch/mips/kernel/signal_o32.c +1 -0
@@ -19,6 +19,7 @@#include <asm/dsp.h> #include <asm/sim.h> #include <asm/unistd.h> +#include <asm/syscalls.h> #include "signal-common.h"
arch/mips/kernel/syscall.c +1 -0
@@ -39,6 +39,7 @@#include <asm/shmparam.h> #include <asm/sync.h> #include <asm/sysmips.h> +#include <asm/syscalls.h> #include <asm/switch_to.h> /*
Signature · 1 line
2.39.2
PATCH 3/20 mips: add missing declarations for trap handlers
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
These exception handlers are all called from assembly code, so they don't normally need a declaration, but without one we now get warnings:
arch/mips/mm/fault.c:323:17: error: no previous prototype for 'do_page_fault' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:447:17: error: no previous prototype for 'do_be' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:752:17: error: no previous prototype for 'do_ov' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:874:17: error: no previous prototype for 'do_fpe' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1027:17: error: no previous prototype for 'do_bp' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1114:17: error: no previous prototype for 'do_tr' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1151:17: error: no previous prototype for 'do_ri' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1402:17: error: no previous prototype for 'do_cpu' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1507:17: error: no previous prototype for 'do_msa_fpe' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1527:17: error: no previous prototype for 'do_msa' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1548:17: error: no previous prototype for 'do_mdmx' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1560:17: error: no previous prototype for 'do_watch' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1587:17: error: no previous prototype for 'do_mcheck' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1612:17: error: no previous prototype for 'do_mt' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1648:17: error: no previous prototype for 'do_dsp' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1656:17: error: no previous prototype for 'do_reserved' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1832:17: error: no previous prototype for 'cache_parity_error' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1880:17: error: no previous prototype for 'do_ftlb' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1909:17: error: no previous prototype for 'do_gsexc' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1944:6: error: no previous prototype for 'ejtag_exception_handler' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:1989:17: error: no previous prototype for 'nmi_exception_handler' [-Werror=missing-prototypes] arch/mips/kernel/unaligned.c:1516:17: error: no previous prototype for 'do_ade' [-Werror=missing-prototypes]
--- arch/mips/include/asm/traps.h | 23 +++++++++++++++++++++++ arch/mips/kernel/r4k-bugs64.c | 1 + arch/mips/kernel/unaligned.c | 1 + arch/mips/mm/fault.c | 1 + 4 files changed, 26 insertions(+)
arch/mips/include/asm/traps.h +23 -0
@@ -41,5 +41,28 @@ extern char except_vec_nmi[]; asmlinkage void do_page_fault(struct pt_regs *regs,unsigned long write,unsigned long address); +asmlinkage void do_ade(struct pt_regs *regs); +asmlinkage void do_be(struct pt_regs *regs); +asmlinkage void do_ov(struct pt_regs *regs); +asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31); +asmlinkage void do_bp(struct pt_regs *regs); +asmlinkage void do_tr(struct pt_regs *regs); +asmlinkage void do_ri(struct pt_regs *regs); +asmlinkage void do_cpu(struct pt_regs *regs); +asmlinkage void do_msa_fpe(struct pt_regs *regs, unsigned int msacsr); +asmlinkage void do_msa(struct pt_regs *regs); +asmlinkage void do_mdmx(struct pt_regs *regs); +asmlinkage void do_watch(struct pt_regs *regs); +asmlinkage void do_mcheck(struct pt_regs *regs); +asmlinkage void do_mt(struct pt_regs *regs); +asmlinkage void do_dsp(struct pt_regs *regs); +asmlinkage void do_reserved(struct pt_regs *regs); +asmlinkage void do_ftlb(void); +asmlinkage void do_gsexc(struct pt_regs *regs, u32 diag1); +asmlinkage void do_daddi_ov(struct pt_regs *regs); + +asmlinkage void cache_parity_error(void); +asmlinkage void ejtag_exception_handler(struct pt_regs *regs); +asmlinkage void __noreturn nmi_exception_handler(struct pt_regs *regs);#endif /* _ASM_TRAPS_H */
arch/mips/kernel/r4k-bugs64.c +1 -0
@@ -14,6 +14,7 @@#include <asm/fpu.h> #include <asm/mipsregs.h> #include <asm/setup.h> +#include <asm/traps.h> static char bug64hit[]__initdata ="reliable operation impossible!\n%s" ;
arch/mips/kernel/unaligned.c +1 -0
@@ -91,6 +91,7 @@#include <asm/inst.h> #include <asm/unaligned-emul.h> #include <asm/mmu_context.h> +#include <asm/traps.h> #include <linux/uaccess.h> #include "access-helper.h"
arch/mips/mm/fault.c +1 -0
@@ -26,6 +26,7 @@#include <asm/mmu_context.h> #include <asm/ptrace.h> #include <asm/highmem.h> /* For VMALLOC_END */ +#include <asm/traps.h> #include <linux/kdebug.h> int show_unhandled_signals =1 ;
Signature · 1 line
2.39.2
PATCH 4/20 mips: rs870e: stop exporting local functions
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
These four functions are exported, but don't have any users, and no prototypes, which now causes warnings:
drivers/platform/mips/rs780e-acpi.c:35:6: error: no previous prototype for 'pm_iowrite' [-Werror=missing-prototypes] drivers/platform/mips/rs780e-acpi.c:41:4: error: no previous prototype for 'pm_ioread' [-Werror=missing-prototypes] drivers/platform/mips/rs780e-acpi.c:47:6: error: no previous prototype for 'pm2_iowrite' [-Werror=missing-prototypes] drivers/platform/mips/rs780e-acpi.c:53:4: error: no previous prototype for 'pm2_ioread' [-Werror=missing-prototypes]
--- drivers/platform/mips/rs780e-acpi.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/platform/mips/rs780e-acpi.c +4 -8
@@ -32,29 +32,25 @@ static u8 pmio_read_index(u16 index, u8 reg)return inb (index +1 ); } -void pm_iowrite (u8 reg,u8 value) +static void pm_iowrite (u8 reg,u8 value) {pmio_write_index (PM_INDEX , reg, value); } -EXPORT_SYMBOL (pm_iowrite); -u8 pm_ioread (u8 reg) +static u8 pm_ioread (u8 reg) {return pmio_read_index (PM_INDEX , reg); } -EXPORT_SYMBOL (pm_ioread); -void pm2_iowrite (u8 reg,u8 value) +static void pm2_iowrite (u8 reg,u8 value) {pmio_write_index (PM2_INDEX , reg, value); } -EXPORT_SYMBOL (pm2_iowrite); -u8 pm2_ioread (u8 reg) +static u8 pm2_ioread (u8 reg) {return pmio_read_index (PM2_INDEX , reg); } -EXPORT_SYMBOL (pm2_ioread);static void acpi_hw_clear_status (void ) {
Signature · 1 line
2.39.2
PATCH 5/20 mips: signal: move sigcontext declarations to header
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Function declarations should be in a shared header to ensure the prototypes match the definition:
arch/mips/kernel/signal.c:439:5: error: no previous prototype for 'setup_sigcontext' [-Werror=missing-prototypes] arch/mips/kernel/signal.c:516:5: error: no previous prototype for 'restore_sigcontext' [-Werror=missing-prototypes]
--- arch/mips/kernel/signal-common.h | 3 +++ arch/mips/kernel/signal_n32.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/mips/kernel/signal-common.h +3 -0
@@ -40,4 +40,7 @@ _restore_fp_context(void __user *fpregs, void __user *csr); extern asmlinkage int _save_msa_all_upper(void __user *buf); extern asmlinkage int _restore_msa_all_upper(void __user *buf); +extern int setup_sigcontext (struct pt_regs *,struct sigcontext __user *); +extern int restore_sigcontext (struct pt_regs *,struct sigcontext __user *); +#endif /* __SIGNAL_COMMON_H */
arch/mips/kernel/signal_n32.c +0 -3
@@ -33,9 +33,6 @@*/ #define __NR_N32_restart_syscall 6214 -extern int setup_sigcontext (struct pt_regs *,struct sigcontext __user *); -extern int restore_sigcontext (struct pt_regs *,struct sigcontext __user *); -struct ucontextn32 {u32 uc_flags;s32 uc_link;
Signature · 1 line
2.39.2
PATCH 6/20 mips: mark local function static if possible
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
These two functions are global but have no extern prototypes or other callers, so it's best to mark them as static, avoiding these warnings:
arch/mips/kernel/mips-cm.c:204:13: error: no previous prototype for '__mips_cm_l2sync_phys_base' [-Werror=missing-prototypes] arch/mips/mm/c-r4k.c:1827:12: error: no previous prototype for 'r4k_cache_init_pm' [-Werror=missing-prototypes]
--- arch/mips/kernel/mips-cm.c | 2 +- arch/mips/mm/c-r4k.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/kernel/mips-cm.c +1 -1
@@ -201,7 +201,7 @@ phys_addr_t __mips_cm_phys_base(void)phys_addr_t mips_cm_phys_base (void ) __attribute__((weak,alias ("__mips_cm_phys_base" ))); -phys_addr_t __mips_cm_l2sync_phys_base (void ) +static phys_addr_t __mips_cm_l2sync_phys_base (void ) {u32 base_reg;
arch/mips/mm/c-r4k.c +1 -1
@@ -1828,7 +1828,7 @@ static struct notifier_block r4k_cache_pm_notifier_block = { .notifier_call = r4k_cache_pm_notifier, }; -int __init r4k_cache_init_pm (void ) +static int __init r4k_cache_init_pm (void ) {return cpu_pm_register_notifier (&r4k_cache_pm_notifier_block); }
Signature · 1 line
2.39.2
PATCH 7/20 mips: move build_tlb_refill_handler() prototype
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Instead of having a declaration for each caller, have one that is shared with the function definition, which avoids a warning:
arch/mips/mm/tlbex.c:2547:6: error: no previous prototype for 'build_tlb_refill_handler' [-Werror=missing-prototypes]
--- arch/mips/include/asm/tlbex.h | 1 + arch/mips/mm/tlb-r3k.c | 3 +-- arch/mips/mm/tlb-r4k.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-)
arch/mips/include/asm/tlbex.h +1 -0
@@ -23,6 +23,7 @@ void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep);void build_tlb_write_entry (u32 **p,struct uasm_label **l,struct uasm_reloc **r,enum tlb_write_entry wmode); +void build_tlb_refill_handler (void );extern void handle_tlbl (void );extern char handle_tlbl_end[];
arch/mips/mm/tlb-r3k.c +1 -2
@@ -23,11 +23,10 @@#include <asm/io.h> #include <asm/bootinfo.h> #include <asm/cpu.h> +#include <asm/tlbex.h> #undef DEBUG_TLB -extern void build_tlb_refill_handler (void ); -/* CP0 hazard avoidance. */ #define BARRIER \ __asm__ __volatile__( \
arch/mips/mm/tlb-r4k.c +1 -2
@@ -22,10 +22,9 @@#include <asm/hazards.h> #include <asm/mmu_context.h> #include <asm/tlb.h> +#include <asm/tlbex.h> #include <asm/tlbmisc.h> -extern void build_tlb_refill_handler (void ); -/* * LOONGSON-2 has a 4 entry itlb which is a subset of jtlb, LOONGSON-3 has * a 4 entry itlb and a 4 entry dtlb which are subsets of jtlb. Unfortunately,
Signature · 1 line
2.39.2
PATCH 8/20 mips: move jump_label_apply_nops() declaration to header
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Instead of an extern declaration in the C file with the caller, move it to an appropriate header, avoiding
arch/mips/kernel/jump_label.c:93:6: error: no previous prototype for 'jump_label_apply_nops' [-Werror=missing-prototypes]
--- arch/mips/include/asm/jump_label.h | 3 +++ arch/mips/kernel/module.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-)
arch/mips/include/asm/jump_label.h +3 -0
@@ -15,6 +15,9 @@#include <linux/types.h> #include <asm/isa-rev.h> +struct module ; +extern void jump_label_apply_nops (struct module *mod); +#define JUMP_LABEL_NOP_SIZE 4#ifdef CONFIG_64BIT
arch/mips/kernel/module.c +1 -2
@@ -20,8 +20,7 @@#include <linux/kernel.h> #include <linux/spinlock.h> #include <linux/jump_label.h> - -extern void jump_label_apply_nops (struct module *mod); +#include <asm/jump_label.h> struct mips_hi16 {struct mips_hi16 *next;
Signature · 1 line
2.39.2
PATCH 9/20 mips: unhide uasm_in_compat_space_p() declaration
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
uasm_in_compat_space_p() has a conditional declaration but is defined unconditionally because of another local user, which causes a warning:
arch/mips/mm/uasm.c:421:5: error: no previous prototype for 'uasm_in_compat_space_p' [-Werror=missing-prototypes]
Make the declaration unconditional to avoid this.
--- arch/mips/include/asm/uasm.h | 2 -- 1 file changed, 2 deletions(-)
arch/mips/include/asm/uasm.h +0 -2
@@ -193,9 +193,7 @@ struct uasm_label {void uasm_build_label (struct uasm_label **lab,u32 *addr,int lid); -#ifdef CONFIG_64BIT int uasm_in_compat_space_p (long addr); -#endif int uasm_rel_hi (long val);int uasm_rel_lo (long val);void UASM_i_LA_mostly (u32 **buf,unsigned int rs,long addr);
Signature · 1 line
2.39.2
PATCH 10/20 mips: fix setup_zero_pages() prototype
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
setup_zero_pages() has a local declaration in a platform specific header, but that is not seen in the file it is defined in:
arch/mips/mm/init.c:60:6: error: no previous prototype for 'setup_zero_pages' [-Werror=missing-prototypes]
Move it to the corresponding global header and include that where needed.
--- arch/mips/include/asm/mach-loongson64/mmzone.h | 1 - arch/mips/include/asm/mmzone.h | 2 ++ arch/mips/mm/init.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
arch/mips/include/asm/mach-loongson64/mmzone.h +0 -1
@@ -18,7 +18,6 @@ extern struct pglist_data *__node_data[];#define NODE_DATA (n) (__node_data[n]) -extern void setup_zero_pages (void );extern void __init prom_init_numa_memory (void );#endif /* _ASM_MACH_MMZONE_H */
arch/mips/include/asm/mmzone.h +2 -0
@@ -20,4 +20,6 @@#define nid_to_addrbase (nid) 0#endif +extern void setup_zero_pages (void ); +#endif /* _ASM_MMZONE_H_ */
arch/mips/mm/init.c +1 -0
@@ -38,6 +38,7 @@#include <asm/dma.h> #include <asm/maar.h> #include <asm/mmu_context.h> +#include <asm/mmzone.h> #include <asm/sections.h> #include <asm/pgalloc.h> #include <asm/tlb.h>
Signature · 1 line
2.39.2
PATCH 11/20 mips: fix tlb_init() prototype
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
There are two definitions for tlb_init(), but no global declaration:
arch/mips/mm/tlb-r4k.c:552:6: error: no previous prototype for 'tlb_init' [-Werror=missing-prototypes] arch/mips/mm/tlb-r3k.c:244:6: error: no previous prototype for 'tlb_init' [-Werror=missing-prototypes]
Move the declaration to asm/setup.h and included it as needed.
--- arch/mips/include/asm/setup.h | 1 + arch/mips/kernel/traps.c | 2 -- arch/mips/mm/tlb-r3k.c | 1 + arch/mips/mm/tlb-r4k.c | 1 + 4 files changed, 3 insertions(+), 2 deletions(-)
arch/mips/include/asm/setup.h +1 -0
@@ -27,5 +27,6 @@ extern unsigned long ebase;extern unsigned int hwrena;extern void per_cpu_trap_init (bool );extern void cpu_cache_init (void ); +extern void tlb_init (void );#endif /* __SETUP_H */
arch/mips/kernel/traps.c +0 -2
@@ -2157,8 +2157,6 @@ void *set_vi_handler(int n, vi_handler_t addr)return set_vi_srs_handler (n, addr,0 ); } -extern void tlb_init (void ); -/* * Timer interrupt */
arch/mips/mm/tlb-r3k.c +1 -0
@@ -23,6 +23,7 @@#include <asm/io.h> #include <asm/bootinfo.h> #include <asm/cpu.h> +#include <asm/setup.h> #include <asm/tlbex.h> #undef DEBUG_TLB
arch/mips/mm/tlb-r4k.c +1 -0
@@ -24,6 +24,7 @@#include <asm/tlb.h> #include <asm/tlbex.h> #include <asm/tlbmisc.h> +#include <asm/setup.h> /* * LOONGSON-2 has a 4 entry itlb which is a subset of jtlb, LOONGSON-3 has
Signature · 1 line
2.39.2
PATCH 12/20 mips: move cache declarations into header
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Some of the cache functions are declared only for their callers, e.g.
arch/mips/mm/c-r3k.c:28:15: error: no previous prototype for 'r3k_cache_size' [-Werror=missing-prototypes] arch/mips/mm/c-r3k.c:63:15: error: no previous prototype for 'r3k_cache_lsize' [-Werror=missing-prototypes] arch/mips/mm/c-r4k.c:1703:6: error: no previous prototype for 'r4k_cache_init' [-Werror=missing-prototypes] arch/mips/mm/sc-mips.c:255:5: error: no previous prototype for 'mips_sc_init' [-Werror=missing-prototypes]
Move all the declarations to asm/cache.h and asm/r4kcache.h where they can be seen by the function definitions.
--- arch/mips/include/asm/cache.h | 6 ++++++ arch/mips/include/asm/r4kcache.h | 4 ++++ arch/mips/kernel/cpu-probe.c | 1 - arch/mips/kernel/cpu-r3k-probe.c | 1 - arch/mips/mm/c-r4k.c | 4 ---- arch/mips/mm/cache.c | 6 ------ 6 files changed, 10 insertions(+), 12 deletions(-)
arch/mips/include/asm/cache.h +6 -0
@@ -17,5 +17,11 @@#define __read_mostly __section(".data..read_mostly")extern void cache_noop (void ); +extern void r3k_cache_init (void ); +extern unsigned long r3k_cache_size (unsigned long ); +extern unsigned long r3k_cache_lsize (unsigned long ); +extern void r4k_cache_init (void ); +extern void octeon_cache_init (void ); +extern void au1x00_fixup_config_od (void );#endif /* _ASM_CACHE_H */
arch/mips/include/asm/r4kcache.h +4 -0
@@ -24,6 +24,10 @@#include <asm/mmzone.h> #include <asm/unroll.h> +extern void r5k_sc_init (void ); +extern void rm7k_sc_init (void ); +extern int mips_sc_init (void ); +extern void (*r4k_blast_dcache)(void );extern void (*r4k_blast_icache)(void );
arch/mips/kernel/cpu-probe.c +0 -1
@@ -179,7 +179,6 @@ void __init check_bugs32(void)static inline int cpu_has_confreg (void ) {#ifdef CONFIG_CPU_R3000 -extern unsigned long r3k_cache_size (unsigned long );unsigned long size1, size2;unsigned long cfg =read_c0_conf ();
arch/mips/kernel/cpu-r3k-probe.c +0 -1
@@ -42,7 +42,6 @@ void __init check_bugs32(void)static inline int cpu_has_confreg (void ) {#ifdef CONFIG_CPU_R3000 -extern unsigned long r3k_cache_size (unsigned long );unsigned long size1, size2;unsigned long cfg =read_c0_conf ();
arch/mips/mm/c-r4k.c +0 -4
@@ -1485,10 +1485,6 @@ static void loongson3_sc_init(void)return ; } -extern int r5k_sc_init (void ); -extern int rm7k_sc_init (void ); -extern int mips_sc_init (void ); -static void setup_scache (void ) {struct cpuinfo_mips *c = ¤t_cpu_data;
arch/mips/mm/cache.c +0 -6
@@ -206,19 +206,13 @@ static inline void setup_protection_map(void)void cpu_cache_init (void ) {if (cpu_has_3k_cache) { -extern void __weak r3k_cache_init (void ); -r3k_cache_init (); }if (cpu_has_4k_cache) { -extern void __weak r4k_cache_init (void ); -r4k_cache_init (); }if (cpu_has_octeon_cache) { -extern void __weak octeon_cache_init (void ); -octeon_cache_init (); }
Signature · 1 line
2.39.2
PATCH 13/20 mips: add missing declarations
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
These are three more functions that are only called from assembler and only need a declaration to avoid the -Wmissing-prototypes warnings:
arch/mips/kernel/signal.c:904:17: error: no previous prototype for 'do_notify_resume' [-Werror=missing-prototypes] arch/mips/kernel/traps.c:370:6: error: no previous prototype for 'show_registers' [-Werror=missing-prototypes] arch/mips/kernel/smp.c:352:17: error: no previous prototype for 'start_secondary' [-Werror=missing-prototypes]
--- arch/mips/include/asm/processor.h | 2 ++ arch/mips/include/asm/signal.h | 1 + arch/mips/include/asm/smp.h | 2 ++ 3 files changed, 5 insertions(+)
arch/mips/include/asm/processor.h +2 -0
@@ -402,4 +402,6 @@ extern int mips_set_process_fp_mode(struct task_struct *task,#define GET_FP_MODE (task) mips_get_process_fp_mode(task)#define SET_FP_MODE (task,value) mips_set_process_fp_mode(task, value) +void show_registers (struct pt_regs *regs); +#endif /* _ASM_PROCESSOR_H */
arch/mips/include/asm/signal.h +1 -0
@@ -31,5 +31,6 @@ extern struct mips_abi mips_abi_32;extern int protected_save_fp_context (void __user *sc);extern int protected_restore_fp_context (void __user *sc); +void do_notify_resume (struct pt_regs *regs,void *unused,__u32 thread_info_flags);#endif /* _ASM_SIGNAL_H */
arch/mips/include/asm/smp.h +2 -0
@@ -61,6 +61,8 @@ extern asmlinkage void smp_bootstrap(void);extern void calculate_cpu_foreign_map (void ); +asmlinkage void start_secondary(void); +/* * this function sends a 'reschedule' IPI to another CPU. * it goes straight through and wastes no time serializing
Signature · 1 line
2.39.2
PATCH 14/20 mips: spram: fix missing prototype warning for spram_config
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
arch/mips/kernel/spram.c:194:6: error: no previous prototype for 'spram_config' [-Werror=missing-prototypes]
--- arch/mips/include/asm/spram.h | 2 +- arch/mips/kernel/spram.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
arch/mips/include/asm/spram.h +1 -1
@@ -3,7 +3,7 @@#define _MIPS_SPRAM_H#if defined(CONFIG_MIPS_SPRAM ) -extern __init void spram_config (void ); +extern void spram_config (void );#else static inline void spram_config (void ) { }#endif /* CONFIG_MIPS_SPRAM */
arch/mips/kernel/spram.c +1 -0
@@ -12,6 +12,7 @@#include <asm/mipsregs.h> #include <asm/r4kcache.h> #include <asm/hazards.h> +#include <asm/spram.h> /* * These definitions are correct for the 24K/34K/74K SPRAM sample
Signature · 1 line
2.39.2
PATCH 15/20 mips: mt: include asm/mips_mt.h
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
These two functions have a global prototype but the header is not included before the function definitions:
arch/mips/kernel/mips-mt.c:50:6: error: no previous prototype for 'mips_mt_regdump' [-Werror=missing-prototypes] arch/mips/kernel/mips-mt.c:159:6: error: no previous prototype for 'mips_mt_set_cpuoptions' [-Werror=missing-prototypes]
--- arch/mips/kernel/mips-mt.c | 1 + 1 file changed, 1 insertion(+)
arch/mips/kernel/mips-mt.c +1 -0
@@ -19,6 +19,7 @@#include <asm/mipsmtregs.h> #include <asm/r4kcache.h> #include <asm/cacheflush.h> +#include <asm/mips_mt.h> int vpelimit;
Signature · 1 line
2.39.2
PATCH 16/20 mips: remove extraneous asm-generic/iomap.h include
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
When this file is included before defining readq(), it misses the declarations for a couple of functions that now become unusable:
lib/iomap.c:156:5: warning: no previous prototype for 'ioread64_lo_hi' [-Wmissing-prototypes] lib/iomap.c:163:5: warning: no previous prototype for 'ioread64_hi_lo' [-Wmissing-prototypes] lib/iomap.c:170:5: warning: no previous prototype for 'ioread64be_lo_hi' [-Wmissing-prototypes] lib/iomap.c:178:5: warning: no previous prototype for 'ioread64be_hi_lo' [-Wmissing-prototypes] lib/iomap.c:264:6: warning: no previous prototype for 'iowrite64_lo_hi' [-Wmissing-prototypes] lib/iomap.c:272:6: warning: no previous prototype for 'iowrite64_hi_lo' [-Wmissing-prototypes] lib/iomap.c:280:6: warning: no previous prototype for 'iowrite64be_lo_hi' [-Wmissing-prototypes] lib/iomap.c:288:6: warning: no previous prototype for 'iowrite64be_hi_lo' [-Wmissing-prototypes]
The file is included again later from asm-generic/io.h, so dropping the initial include statement makes it do the right thing, both for avoiding the warning and for actually providing these functions.
--- arch/mips/include/asm/io.h | 2 -- 1 file changed, 2 deletions(-)
arch/mips/include/asm/io.h +0 -2
@@ -187,8 +187,6 @@ void iounmap(const volatile void __iomem *addr);#define ioremap_wc (offset, size) \ ioremap_prot((offset), (size), boot_cpu_data.writecombine) -#include <asm-generic/iomap.h> -#if defined(CONFIG_CPU_CAVIUM_OCTEON )#define war_io_reorder_wmb () wmb()#else
Signature · 1 line
2.39.2
PATCH 17/20 mips: suspend: include linux/suspend.h as needed
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
A couple of functions are defined by the architecture and declared in linux/suspend.h, but mips is lacking the corresponding #include statement before the definition:
arch/mips/power/cpu.c:16:6: warning: no previous prototype for 'save_processor_state' [-Wmissing-prototypes] arch/mips/power/cpu.c:26:6: warning: no previous prototype for 'restore_processor_state' [-Wmissing-prototypes] arch/mips/power/cpu.c:36:5: warning: no previous prototype for 'pfn_is_nosave' [-Wmissing-prototypes] arch/mips/power/hibernate.c:6:5: warning: no previous prototype for 'swsusp_arch_resume' [-Wmissing-prototypes]
--- arch/mips/power/cpu.c | 1 + arch/mips/power/hibernate.c | 1 + 2 files changed, 2 insertions(+)
arch/mips/power/cpu.c +1 -0
@@ -6,6 +6,7 @@* Author: Hu Hongbing <[email protected]> * Wu Zhangjin <[email protected]> */ +#include <linux/suspend.h> #include <asm/sections.h> #include <asm/fpu.h> #include <asm/dsp.h>
arch/mips/power/hibernate.c +1 -0
@@ -1,4 +1,5 @@// SPDX-License-Identifier: GPL-2.0 +#include <linux/suspend.h> #include <asm/tlbflush.h> extern int restore_image (void );
Signature · 1 line
2.39.2
PATCH 18/20 mips: hide conditionally unused functions
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
A couple of functions are defined unconditionally but have a conditional declaration:
arch/mips/mm/tlb-r4k.c:461:12: error: no previous prototype for 'add_temporary_entry' [-Werror=missing-prototypes] arch/mips/mm/pgtable-64.c:92:7: error: no previous prototype for 'mk_pmd' [-Werror=missing-prototypes] arch/mips/mm/pgtable-64.c:101:6: error: no previous prototype for 'set_pmd_at' [-Werror=missing-prototypes]
Since there are no callers in these configurations, add the same #ifdef checks around the definitions.
--- arch/mips/mm/pgtable-64.c | 2 ++ arch/mips/mm/tlb-r4k.c | 2 ++ 2 files changed, 4 insertions(+)
arch/mips/mm/pgtable-64.c +2 -0
@@ -89,6 +89,7 @@ void pud_init(void *addr) }#endif +#ifdef CONFIG_TRANSPARENT_HUGEPAGE pmd_t mk_pmd (struct page *page,pgprot_t prot) {pmd_t pmd;
@@ -103,6 +104,7 @@ void set_pmd_at(struct mm_struct *mm, unsigned long addr, { *pmdp = pmd; } +#endif void __init pagetable_init (void ) {
arch/mips/mm/tlb-r4k.c +2 -0
@@ -458,6 +458,7 @@ EXPORT_SYMBOL(has_transparent_hugepage);int temp_tlb_entry; +#ifndef CONFIG_64BIT __init int add_temporary_entry (unsigned long entrylo0,unsigned long entrylo1,unsigned long entryhi,unsigned long pagemask) {
@@ -496,6 +497,7 @@ __init int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,local_irq_restore (flags); return ret; } +#endif static int ntlb;static int __init set_ntlb (char *str)
Signature · 1 line
2.39.2
PATCH 19/20 mips: smp: fix setup_profiling_timer() prototype
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The function is unconditionally defined in smp.c but is conditionally declared in a header that is not included here.
arch/mips/kernel/smp.c:473:5: error: no previous prototype for 'setup_profiling_timer' [-Werror=missing-prototypes]
Add the missing #include and #ifdef to match the declaration.
--- arch/mips/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+)
arch/mips/kernel/smp.c +3 -0
@@ -10,6 +10,7 @@#include <linux/delay.h> #include <linux/init.h> #include <linux/interrupt.h> +#include <linux/profile.h> #include <linux/smp.h> #include <linux/spinlock.h> #include <linux/threads.h>
@@ -468,11 +469,13 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)return 0 ; } +#ifdef CONFIG_PROFILING /* Not really SMP stuff ... */ int setup_profiling_timer (unsigned int multiplier) {return 0 ; } +#endif static void flush_tlb_all_ipi (void *info) {
Signature · 1 line
2.39.2
PATCH 20/20 mips: kexec: include linux/reboot.h
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Two functions are provided for kexec, but the mips implementation is missing the corresponding #include statment:
arch/mips/kernel/machine_kexec.c:136:1: error: no previous prototype for 'machine_shutdown' [-Werror=missing-prototypes] arch/mips/kernel/machine_kexec.c:152:1: error: no previous prototype for 'machine_crash_shutdown' [-Werror=missing-prototypes]
--- arch/mips/kernel/machine_kexec.c | 1 + 1 file changed, 1 insertion(+)
arch/mips/kernel/machine_kexec.c +1 -0
@@ -8,6 +8,7 @@#include <linux/mm.h> #include <linux/delay.h> #include <linux/libfdt.h> +#include <linux/reboot.h> #include <asm/cacheflush.h> #include <asm/page.h>
Signature · 1 line
2.39.2
Thomas Bogendoerfer
maintainerQuoted 3 lines · Arnd Bergmann
The patches could either go through Thomas's mips tree, or alternatively through linux-mm along with the hexagon patches that Andrew has already merged.
I'd prefer to have in MIPS tree to also fix the other missing pieces.
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]