Skip to content

Commit 31c67b5

Browse files
committed
openrisc: Add prototype for die to bug.h
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>
1 parent 8d4a142 commit 31c67b5

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

arch/openrisc/include/asm/bug.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
#ifndef __ASM_OPENRISC_BUG_H
3+
#define __ASM_OPENRISC_BUG_H
4+
5+
#include <asm-generic/bug.h>
6+
7+
struct pt_regs;
8+
9+
void __noreturn die(const char *str, struct pt_regs *regs, long err);
10+
11+
#endif /* __ASM_OPENRISC_BUG_H */

arch/openrisc/kernel/traps.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/kallsyms.h>
3131
#include <linux/uaccess.h>
3232

33+
#include <asm/bug.h>
3334
#include <asm/io.h>
3435
#include <asm/processor.h>
3536
#include <asm/unwinder.h>

arch/openrisc/mm/fault.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/perf_event.h>
1919

2020
#include <linux/uaccess.h>
21+
#include <asm/bug.h>
2122
#include <asm/mmu_context.h>
2223
#include <asm/siginfo.h>
2324
#include <asm/signal.h>
@@ -30,8 +31,6 @@
3031
*/
3132
volatile pgd_t *current_pgd[NR_CPUS];
3233

33-
extern void __noreturn die(char *, struct pt_regs *, long);
34-
3534
asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long address,
3635
unsigned long vector, int write_acc);
3736

0 commit comments

Comments
 (0)