Skip to content

Commit d951b20

Browse files
ConchuODpalmer-dabbelt
authored andcommitted
riscv: traps: add missing prototype
Sparse complains: arch/riscv/kernel/traps.c:213:6: warning: symbol 'shadow_stack' was not declared. Should it be static? The variable is used in entry.S, so declare shadow_stack there alongside SHADOW_OVERFLOW_STACK_SIZE. Fixes: 31da94c ("riscv: add VMAP_STACK overflow detection") Signed-off-by: Conor Dooley <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent b5c3aca commit d951b20

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

arch/riscv/include/asm/thread_info.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242

4343
#ifndef __ASSEMBLY__
4444

45+
extern long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE / sizeof(long)];
46+
4547
#include <asm/processor.h>
4648
#include <asm/csr.h>
4749

arch/riscv/kernel/traps.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020

2121
#include <asm/asm-prototypes.h>
2222
#include <asm/bug.h>
23+
#include <asm/csr.h>
2324
#include <asm/processor.h>
2425
#include <asm/ptrace.h>
25-
#include <asm/csr.h>
26+
#include <asm/thread_info.h>
2627

2728
int show_unhandled_signals = 1;
2829

0 commit comments

Comments
 (0)