Skip to content

Commit

Permalink
RISC-V: stacktrace: Declare sp_in_global outside ifdef
Browse files Browse the repository at this point in the history
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 <linux@roeck-us.net>
Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
  • Loading branch information
groeck authored and palmer-dabbelt committed Apr 21, 2020
1 parent ae83d0b commit af2bdf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/riscv/kernel/stacktrace.c
Expand Up @@ -12,15 +12,15 @@
#include <linux/stacktrace.h>
#include <linux/ftrace.h>

register unsigned long sp_in_global __asm__("sp");

#ifdef CONFIG_FRAME_POINTER

struct stackframe {
unsigned long fp;
unsigned long ra;
};

register unsigned 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)
{
Expand Down

0 comments on commit af2bdf8

Please sign in to comment.