]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
openrisc: Add prototype for die to bug.h
authorStafford Horne <shorne@gmail.com>
Sun, 20 Aug 2023 20:02:02 +0000 (21:02 +0100)
committerStafford Horne <shorne@gmail.com>
Mon, 21 Aug 2023 07:15:25 +0000 (08:15 +0100)
When compiling with W=1 enabling -Wmissing-prototypes the compiler
warns:

  arch/openrisc/kernel/traps.c:221:17: sing-prototypesrror: no previous prototype for 'die' [-Werror=missing-prototypes]

Fix by adding the prototype to the appropriate header file and including
the header file in the appropriate C files.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Closes: https://lore.kernel.org/linux-kernel/20230810141947.1236730-17-arnd@kernel.org/
Signed-off-by: Stafford Horne <shorne@gmail.com>
arch/openrisc/include/asm/bug.h [new file with mode: 0644]
arch/openrisc/kernel/traps.c
arch/openrisc/mm/fault.c

diff --git a/arch/openrisc/include/asm/bug.h b/arch/openrisc/include/asm/bug.h
new file mode 100644 (file)
index 0000000..6d04776
--- /dev/null
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_OPENRISC_BUG_H
+#define __ASM_OPENRISC_BUG_H
+
+#include <asm-generic/bug.h>
+
+struct pt_regs;
+
+void __noreturn die(const char *str, struct pt_regs *regs, long err);
+
+#endif /* __ASM_OPENRISC_BUG_H */
index f221e4b4298f220b9a2408df3acd9de77ed30a25..879fbf57c04ef73c8e3230c40d41c6af3c826a19 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/kallsyms.h>
 #include <linux/uaccess.h>
 
+#include <asm/bug.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/unwinder.h>
index 01dc18aa8410f49a9abfa24a3420b5ebd4d85883..29e232d78d8285f370b5d2faaa77aa061af49e66 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/perf_event.h>
 
 #include <linux/uaccess.h>
+#include <asm/bug.h>
 #include <asm/mmu_context.h>
 #include <asm/siginfo.h>
 #include <asm/signal.h>
@@ -30,8 +31,6 @@
  */
 volatile pgd_t *current_pgd[NR_CPUS];
 
-extern void __noreturn die(char *, struct pt_regs *, long);
-
 asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long address,
                              unsigned long vector, int write_acc);