riscv: remove useless pc check in stacktrace handling
PATCH 1/1 riscv: remove useless pc check in stacktrace handling
Checking for pc to be a kernel text address at this location is useless since pc == handle_exception. Remove this check.
Signed-off-by Clément Léger <[email protected]>
--- arch/riscv/kernel/stacktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/stacktrace.c +1 -1
@@ -72,7 +72,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, pc =ftrace_graph_ret_addr (current, &graph_idx, frame->ra, &frame->ra);if (pc == (unsigned long )handle_exception) { -if (unlikely (!__kernel_text_address (pc) || !fn (arg, pc))) +if (unlikely (!fn (arg, pc)))break ; pc = ((struct pt_regs *)sp)->epc;
Signature · 1 line
2.45.2
Hi Clément,
Quoted 14 lines · Clément Léger
Checking for pc to be a kernel text address at this location is useless since pc ==
handle_exception. Remove this check.Signed-off-by Clément Léger <[email protected]>--- arch/riscv/kernel/stacktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/kernel/stacktrace.c +0
-0
arch/riscv/kernel/stacktrace.c void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, · line 78
Quoted 8 lines
arch/riscv/kernel/stacktrace.c +1
-1@@ -72,7 +72,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, pc =ftrace_graph_ret_addr (current, &graph_idx, frame->ra, &frame->ra);if (pc == (unsigned long )handle_exception) { -if (unlikely (!__kernel_text_address (pc) || !fn (arg, pc))) +if (unlikely (!fn (arg, pc)))break ; pc = ((struct pt_regs *)sp)->epc;
Reviewed-by Alexandre Ghiti <[email protected]>
Thanks,
Alex