mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
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 <wangkefeng.wang@huawei.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
parent
0983834a83
commit
dec822771b
1 changed files with 2 additions and 3 deletions
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#include <asm/stacktrace.h>
|
#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
|
#ifdef CONFIG_FRAME_POINTER
|
||||||
|
|
||||||
|
@ -28,9 +28,8 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
|
||||||
sp = user_stack_pointer(regs);
|
sp = user_stack_pointer(regs);
|
||||||
pc = instruction_pointer(regs);
|
pc = instruction_pointer(regs);
|
||||||
} else if (task == NULL || task == current) {
|
} else if (task == NULL || task == current) {
|
||||||
const register unsigned long current_sp = sp_in_global;
|
|
||||||
fp = (unsigned long)__builtin_frame_address(0);
|
fp = (unsigned long)__builtin_frame_address(0);
|
||||||
sp = current_sp;
|
sp = sp_in_global;
|
||||||
pc = (unsigned long)walk_stackframe;
|
pc = (unsigned long)walk_stackframe;
|
||||||
} else {
|
} else {
|
||||||
/* task blocked in __switch_to */
|
/* task blocked in __switch_to */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue