Declare externally used functions in reset.c to resolve compilation warnings. Fix follow errors with gcc-14 when -Werror: arch/mips/dec/reset.c:22:17: error: no previous prototype for ‘dec_machine_restart’ [-Werror=missing-prototypes] 22 | void __noreturn dec_machine_restart(char *command) | ^~~~~~~~~~~~~~~~~~~ arch/mips/dec/reset.c:27:17: error: no previous prototype for ‘dec_machine_halt’ [-Werror=missing-prototypes] 27 | void __noreturn dec_machine_halt(void) | ^~~~~~~~~~~~~~~~ arch/mips/dec/reset.c:32:17: error: no previous prototype for ‘dec_machine_power_off’ [-Werror=missing-prototypes] 32 | void __noreturn dec_machine_power_off(void) | ^~~~~~~~~~~~~~~~~~~~~ arch/mips/dec/reset.c:38:13: error: no previous prototype for ‘dec_intr_halt’ [-Werror=missing-prototypes] 38 | irqreturn_t dec_intr_halt(int irq, void *dev_id) | ^~~~~~~~~~~~~ cc1: all warnings being treated as errors make[7]: *** [scripts/Makefile.build:207: arch/mips/dec/reset.o] Error 1 make[7]: *** Waiting for unfinished jobs.... In passing, also correct the include file ordering in setup.c as it doesn't merit a separate commit. Link: https://lore.kernel.org/all/Z8A0JeFYfBxXOFCD@xxxxxxxxxxxxxxxx/ Signed-off-by: WangYuli <wangyuli@xxxxxxxxxxxxx> --- Changelog: *v1->v2: Rationalize the copyright for reset.h. --- arch/mips/dec/prom/init.c | 3 +-- arch/mips/dec/reset.c | 2 ++ arch/mips/dec/setup.c | 9 ++------- arch/mips/include/asm/dec/reset.h | 20 ++++++++++++++++++++ 4 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 arch/mips/include/asm/dec/reset.h diff --git a/arch/mips/dec/prom/init.c b/arch/mips/dec/prom/init.c index 8d74d7d6c05b..a8393052a443 100644 --- a/arch/mips/dec/prom/init.c +++ b/arch/mips/dec/prom/init.c @@ -18,7 +18,7 @@ #include <asm/processor.h> #include <asm/dec/prom.h> - +#include <asm/dec/reset.h> int (*__rex_bootinit)(void); int (*__rex_bootread)(void); @@ -88,7 +88,6 @@ static void __init which_prom(s32 magic, s32 *prom_vec) void __init prom_init(void) { - extern void dec_machine_halt(void); static const char cpu_msg[] __initconst = "Sorry, this kernel is compiled for a wrong CPU type!\n"; s32 argc = fw_arg0; diff --git a/arch/mips/dec/reset.c b/arch/mips/dec/reset.c index 3df01f1da347..ee1ad38f4a69 100644 --- a/arch/mips/dec/reset.c +++ b/arch/mips/dec/reset.c @@ -10,6 +10,8 @@ #include <asm/addrspace.h> +#include <asm/dec/reset.h> + typedef void __noreturn (* noret_func_t)(void); static inline void __noreturn back_to_prom(void) diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c index 87f0a1436bf9..6b100c7d0633 100644 --- a/arch/mips/dec/setup.c +++ b/arch/mips/dec/setup.c @@ -18,10 +18,10 @@ #include <linux/memblock.h> #include <linux/param.h> #include <linux/percpu-defs.h> +#include <linux/pm.h> #include <linux/sched.h> #include <linux/spinlock.h> #include <linux/types.h> -#include <linux/pm.h> #include <asm/addrspace.h> #include <asm/bootinfo.h> @@ -48,14 +48,9 @@ #include <asm/dec/kn02ca.h> #include <asm/dec/kn03.h> #include <asm/dec/kn230.h> +#include <asm/dec/reset.h> #include <asm/dec/system.h> - -extern void dec_machine_restart(char *command); -extern void dec_machine_halt(void); -extern void dec_machine_power_off(void); -extern irqreturn_t dec_intr_halt(int irq, void *dev_id); - unsigned long dec_kn_slot_base, dec_kn_slot_size; EXPORT_SYMBOL(dec_kn_slot_base); diff --git a/arch/mips/include/asm/dec/reset.h b/arch/mips/include/asm/dec/reset.h new file mode 100644 index 000000000000..c1557b88264c --- /dev/null +++ b/arch/mips/include/asm/dec/reset.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Reset a DECstation machine. + * + * File created to eliminate warnings; copyright from reset.c. + * + * Copyright (C) 199x the Anonymous + * Copyright (C) 2001, 2002, 2003 Maciej W. Rozycki + */ + +#ifndef __ASM_DEC_RESET_H + +#include <linux/interrupt.h> + +extern void __noreturn dec_machine_restart(char *command); +extern void __noreturn dec_machine_halt(void); +extern void __noreturn dec_machine_power_off(void); +extern irqreturn_t dec_intr_halt(int irq, void *dev_id); + +#endif /* __ASM_DEC_RESET_H */ -- 2.47.2