Skip to content

Commit bb0511d

Browse files
seehearfeelchenhuacai
authored andcommitted
LoongArch: Make regs_irqs_disabled() more clear
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: 803b0fc ("LoongArch: Add process management") Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent fb8e9f5 commit bb0511d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/loongarch/include/asm/ptrace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ struct pt_regs {
3333
unsigned long __last[];
3434
} __aligned(8);
3535

36-
static inline int regs_irqs_disabled(struct pt_regs *regs)
36+
static __always_inline bool regs_irqs_disabled(struct pt_regs *regs)
3737
{
38-
return arch_irqs_disabled_flags(regs->csr_prmd);
38+
return !(regs->csr_prmd & CSR_PRMD_PIE);
3939
}
4040

4141
static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)

0 commit comments

Comments
 (0)