Skip to content

Commit

Permalink
riscv: stacktrace: Move register keyword to beginning of declaration
Browse files Browse the repository at this point in the history
Using global sp_in_global directly to fix the following warning,

arch/riscv/kernel/stacktrace.c:31:3: warning: ‘register’ is not at beginning of declaration [-Wold-style-declaration]
31 |   const register unsigned long current_sp = sp_in_global;
   |   ^~~~~

Signed-off-by: Kefeng Wang <[email protected]>
Signed-off-by: Palmer Dabbelt <[email protected]>
  • Loading branch information
Kefeng Wang authored and palmer-dabbelt committed Jan 15, 2021
1 parent 0983834 commit dec8227
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arch/riscv/kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <asm/stacktrace.h>

register unsigned long sp_in_global __asm__("sp");
register const unsigned long sp_in_global __asm__("sp");

#ifdef CONFIG_FRAME_POINTER

Expand All @@ -28,9 +28,8 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
sp = user_stack_pointer(regs);
pc = instruction_pointer(regs);
} else if (task == NULL || task == current) {
const register unsigned long current_sp = sp_in_global;
fp = (unsigned long)__builtin_frame_address(0);
sp = current_sp;
sp = sp_in_global;
pc = (unsigned long)walk_stackframe;
} else {
/* task blocked in __switch_to */
Expand Down

0 comments on commit dec8227

Please sign in to comment.