Commit af2bdf82 authored by Guenter Roeck's avatar Guenter Roeck Committed by Palmer Dabbelt

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: 52e7c52d ("RISC-V: Stop relying on GCC's register allocator's hueristics")
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent ae83d0b4
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include <linux/stacktrace.h> #include <linux/stacktrace.h>
#include <linux/ftrace.h> #include <linux/ftrace.h>
register unsigned long sp_in_global __asm__("sp");
#ifdef CONFIG_FRAME_POINTER #ifdef CONFIG_FRAME_POINTER
struct stackframe { struct stackframe {
...@@ -19,8 +21,6 @@ struct stackframe { ...@@ -19,8 +21,6 @@ struct stackframe {
unsigned long ra; unsigned long ra;
}; };
register unsigned long sp_in_global __asm__("sp");
void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
bool (*fn)(unsigned long, void *), void *arg) bool (*fn)(unsigned long, void *), void *arg)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment