Skip to content

Commit af2bdf8

Browse files
groeckpalmer-dabbelt
authored andcommitted
RISC-V: stacktrace: Declare sp_in_global outside ifdef
riscv:allnoconfig and riscv:tinyconfig fail to compile. arch/riscv/kernel/stacktrace.c: In function 'walk_stackframe': arch/riscv/kernel/stacktrace.c:78:8: error: 'sp_in_global' undeclared sp_in_global is declared inside CONFIG_FRAME_POINTER but used outside of it. Fixes: 52e7c52 ("RISC-V: Stop relying on GCC's register allocator's hueristics") Signed-off-by: Guenter Roeck <[email protected]> Reviewed-by: Palmer Dabbelt <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent ae83d0b commit af2bdf8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/riscv/kernel/stacktrace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
#include <linux/stacktrace.h>
1313
#include <linux/ftrace.h>
1414

15+
register unsigned long sp_in_global __asm__("sp");
16+
1517
#ifdef CONFIG_FRAME_POINTER
1618

1719
struct stackframe {
1820
unsigned long fp;
1921
unsigned long ra;
2022
};
2123

22-
register unsigned long sp_in_global __asm__("sp");
23-
2424
void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
2525
bool (*fn)(unsigned long, void *), void *arg)
2626
{

0 commit comments

Comments
 (0)