diff mbox series

[2/7] MIPS: dec: Create reset.h

Message ID 65F124DA37C9CC6A+20250218125633.666501-1-wangyuli@uniontech.com (mailing list archive)
State New
Headers show
Series MIPS: decstation_64_defconfig: Compile the kernel with warnings as errors | expand

Commit Message

WangYuli Feb. 18, 2025, 12:56 p.m. UTC
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.

Signed-off-by: WangYuli <wangyuli@uniontech.com>
---
 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 | 17 +++++++++++++++++
 4 files changed, 22 insertions(+), 9 deletions(-)
 create mode 100644 arch/mips/include/asm/dec/reset.h
diff mbox series

Patch

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..56a7ecf06b7b 100644
--- a/arch/mips/dec/setup.c
+++ b/arch/mips/dec/setup.c
@@ -17,11 +17,11 @@ 
 #include <linux/irqnr.h>
 #include <linux/memblock.h>
 #include <linux/param.h>
+#include <linux/pm.h>
 #include <linux/percpu-defs.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..5e7b27561fbe
--- /dev/null
+++ b/arch/mips/include/asm/dec/reset.h
@@ -0,0 +1,17 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Reset a DECstation machine.
+ *
+ * Copyright (C) 2025  WangYuli
+ */
+
+#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 */