RISC-V: stacktrace: Declare sp_in_global outside ifdef
PATCH 1/1 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.
---
Apologies for the noise if this has already been fixed somewhere.
arch/riscv/kernel/stacktrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/stacktrace.c +2 -2
@@ -12,6 +12,8 @@#include <linux/stacktrace.h> #include <linux/ftrace.h> +registerunsigned long sp_in_global __asm__("sp" ); +#ifdef CONFIG_FRAME_POINTER struct stackframe {
@@ -19,8 +21,6 @@ struct stackframe {unsigned long ra; }; -registerunsigned long sp_in_global __asm__("sp" ); - void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,bool (*fn)(unsigned long ,void *),void *arg) {
Signature · 1 line
2.17.1
Quoted 31 lines · On Mon, 13 Apr 2020 09:12:34 PDT (-0700), [email protected] wrote:
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_globalis declared insideCONFIG_FRAME_POINTERbut used outside of it.Fixes 52e7c52d2ded ("RISC-V: Stop relying on GCC's register allocator's hueristics")Cc Palmer Dabbelt <[email protected]>Signed-off-by Guenter Roeck <[email protected]>---
Apologies for the noise if this has already been fixed somewhere.arch/riscv/kernel/stacktrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/riscv/kernel/stacktrace.c +2
-0@@ -12,6 +12,8 @@#include <linux/stacktrace.h> #include <linux/ftrace.h> +registerunsigned long sp_in_global __asm__("sp" ); +#ifdef CONFIG_FRAME_POINTER struct stackframe {
arch/riscv/kernel/stacktrace.c struct stackframe { · line 26
Quoted 8 lines
arch/riscv/kernel/stacktrace.c +0
-2@@ -19,8 +21,6 @@ struct stackframe {unsigned long ra; }; -registerunsigned long sp_in_global __asm__("sp" ); - void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,bool (*fn)(unsigned long ,void *),void *arg) {
Thanks. This is on fixes.