]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
LoongArch: Make regs_irqs_disabled() more clear
authorTiezhu Yang <yangtiezhu@loongson.cn>
Thu, 24 Apr 2025 12:15:41 +0000 (20:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:50:45 +0000 (07:50 +0200)
commiteaa0849818ebdcb063c95a0cb7abd1218f71990e
treefae53aa797bd94c4ebe85066ccef8625c2bcda4e
parent5767f4ac64284e97284ca29ac47824ec423766c6
LoongArch: Make regs_irqs_disabled() more clear

[ Upstream commit bb0511d59db9b3e40c8d51f0d151ccd0fd44071d ]

In the current code, the definition of regs_irqs_disabled() is actually
"!(regs->csr_prmd & CSR_CRMD_IE)" because arch_irqs_disabled_flags() is
defined as "!(flags & CSR_CRMD_IE)", it looks a little strange.

Define regs_irqs_disabled() as !(regs->csr_prmd & CSR_PRMD_PIE) directly
to make it more clear, no functional change.

While at it, the return value of regs_irqs_disabled() is true or false,
so change its type to reflect that and also make it always inline.

Fixes: 803b0fc5c3f2 ("LoongArch: Add process management")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/loongarch/include/asm/ptrace.h