mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] riscv: Make regs_irqs_disabled() more clear
@ 2025-04-22 11:31 Tiezhu Yang
  2025-04-22 15:08 ` Alexandre Ghiti
  2025-06-02 22:12 ` patchwork-bot+linux-riscv
  0 siblings, 2 replies; 3+ messages in thread
From: Tiezhu Yang @ 2025-04-22 11:31 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: Huacai Chen, linux-riscv, linux-kernel

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

Suggested-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/riscv/include/asm/ptrace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/include/asm/ptrace.h b/arch/riscv/include/asm/ptrace.h
index 2910231977cb..a7dc0e330757 100644
--- a/arch/riscv/include/asm/ptrace.h
+++ b/arch/riscv/include/asm/ptrace.h
@@ -175,7 +175,7 @@ static inline unsigned long regs_get_kernel_argument(struct pt_regs *regs,
 	return 0;
 }
 
-static inline int regs_irqs_disabled(struct pt_regs *regs)
+static __always_inline bool regs_irqs_disabled(struct pt_regs *regs)
 {
 	return !(regs->status & SR_PIE);
 }
-- 
2.42.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] riscv: Make regs_irqs_disabled() more clear
  2025-04-22 11:31 [PATCH] riscv: Make regs_irqs_disabled() more clear Tiezhu Yang
@ 2025-04-22 15:08 ` Alexandre Ghiti
  2025-06-02 22:12 ` patchwork-bot+linux-riscv
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Ghiti @ 2025-04-22 15:08 UTC (permalink / raw)
  To: Tiezhu Yang, Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: Huacai Chen, linux-riscv, linux-kernel

Hi Tiezhu,

On 22/04/2025 13:31, Tiezhu Yang wrote:
> The return value of regs_irqs_disabled() is true or false, so change
> its type to reflect that and also make it always inline.
>
> Suggested-by: Huacai Chen <chenhuacai@loongson.cn>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>   arch/riscv/include/asm/ptrace.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/include/asm/ptrace.h b/arch/riscv/include/asm/ptrace.h
> index 2910231977cb..a7dc0e330757 100644
> --- a/arch/riscv/include/asm/ptrace.h
> +++ b/arch/riscv/include/asm/ptrace.h
> @@ -175,7 +175,7 @@ static inline unsigned long regs_get_kernel_argument(struct pt_regs *regs,
>   	return 0;
>   }
>   
> -static inline int regs_irqs_disabled(struct pt_regs *regs)
> +static __always_inline bool regs_irqs_disabled(struct pt_regs *regs)
>   {
>   	return !(regs->status & SR_PIE);
>   }

Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>

Thanks,

Alex


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] riscv: Make regs_irqs_disabled() more clear
  2025-04-22 11:31 [PATCH] riscv: Make regs_irqs_disabled() more clear Tiezhu Yang
  2025-04-22 15:08 ` Alexandre Ghiti
@ 2025-06-02 22:12 ` patchwork-bot+linux-riscv
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-riscv @ 2025-06-02 22:12 UTC (permalink / raw)
  To: Tiezhu Yang
  Cc: linux-riscv, paul.walmsley, palmer, aou, chenhuacai, linux-kernel

Hello:

This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@dabbelt.com>:

On Tue, 22 Apr 2025 19:31:56 +0800 you wrote:
> The return value of regs_irqs_disabled() is true or false, so change
> its type to reflect that and also make it always inline.
> 
> Suggested-by: Huacai Chen <chenhuacai@loongson.cn>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>  arch/riscv/include/asm/ptrace.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - riscv: Make regs_irqs_disabled() more clear
    https://git.kernel.org/riscv/c/91a072f84c2d

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-02 22:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-22 11:31 [PATCH] riscv: Make regs_irqs_disabled() more clear Tiezhu Yang
2025-04-22 15:08 ` Alexandre Ghiti
2025-06-02 22:12 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®