Skip to content

Commit dec8227

Browse files
Kefeng Wangpalmer-dabbelt
authored andcommitted
riscv: stacktrace: Move register keyword to beginning of declaration
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]>
1 parent 0983834 commit dec8227

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/riscv/kernel/stacktrace.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include <asm/stacktrace.h>
1616

17-
register unsigned long sp_in_global __asm__("sp");
17+
register const unsigned long sp_in_global __asm__("sp");
1818

1919
#ifdef CONFIG_FRAME_POINTER
2020

@@ -28,9 +28,8 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
2828
sp = user_stack_pointer(regs);
2929
pc = instruction_pointer(regs);
3030
} else if (task == NULL || task == current) {
31-
const register unsigned long current_sp = sp_in_global;
3231
fp = (unsigned long)__builtin_frame_address(0);
33-
sp = current_sp;
32+
sp = sp_in_global;
3433
pc = (unsigned long)walk_stackframe;
3534
} else {
3635
/* task blocked in __switch_to */

0 commit comments

Comments
 (0)