Re: [PATCH v1] LoongArch: Remove unnecessary checks in bt_address()

From: Tiezhu Yang
Date: Tue Dec 09 2025 - 20:29:07 EST


On 2025/12/9 下午4:30, Huacai Chen wrote:
Hi, Tiezhu,

On Tue, Dec 9, 2025 at 2:18 PM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:

...
extern unsigned long eentry;

- if (__kernel_text_address(ra))
- return ra;
-
- if (__module_text_address(ra))
- return ra;
I think the correct way is to remove the __module_text_address()
condition but keep the __kernel_text_address() condition. Then return
0 at the end of this function, and remove the __kernel_text_address()
condition out of this function.

It can not remove the check of __kernel_text_address() after calling
bt_address() because it needs to validate the calculated address for
exception, then no need to keep the __kernel_text_address() condition
in bt_address() because it will check the PC outside bt_address().

Thanks,
Tiezhu