diff mbox series

riscv: signal: Remove unlikely() from WARN_ON() condition

Message ID 20240620033434.3778156-1-quic_zhonhan@quicinc.com (mailing list archive)
State Accepted
Commit e1d96a07ba4b8856b86860cdef3b8d33283939ec
Headers show
Series riscv: signal: Remove unlikely() from WARN_ON() condition | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-1-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-1-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-1-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-1-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-1-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-1-test-6 success .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-1-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-1-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-1-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-1-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-1-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-1-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

Zhongqiu Han June 20, 2024, 3:34 a.m. UTC
"WARN_ON(unlikely(x))" is excessive. WARN_ON() already uses unlikely()
internally.

Signed-off-by: Zhongqiu Han <quic_zhonhan@quicinc.com>
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 arch/riscv/kernel/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Chiu June 20, 2024, 6:56 a.m. UTC | #1
On Thu, Jun 20, 2024 at 11:35 AM Zhongqiu Han <quic_zhonhan@quicinc.com> wrote:
>
> "WARN_ON(unlikely(x))" is excessive. WARN_ON() already uses unlikely()
> internally.
>
> Signed-off-by: Zhongqiu Han <quic_zhonhan@quicinc.com>
> Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com>

Reviewed-by: Andy Chiu <andy.chiu@sifive.com>

> ---
>  arch/riscv/kernel/signal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c
> index 5a2edd7f027e..dcd282419456 100644
> --- a/arch/riscv/kernel/signal.c
> +++ b/arch/riscv/kernel/signal.c
> @@ -84,7 +84,7 @@ static long save_v_state(struct pt_regs *regs, void __user **sc_vec)
>         datap = state + 1;
>
>         /* datap is designed to be 16 byte aligned for better performance */
> -       WARN_ON(unlikely(!IS_ALIGNED((unsigned long)datap, 16)));
> +       WARN_ON(!IS_ALIGNED((unsigned long)datap, 16));
>
>         get_cpu_vector_context();
>         riscv_v_vstate_save(&current->thread.vstate, regs);
> --
> 2.25.1
>
patchwork-bot+linux-riscv@kernel.org July 25, 2024, 1:20 p.m. UTC | #2
Hello:

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

On Thu, 20 Jun 2024 11:34:34 +0800 you wrote:
> "WARN_ON(unlikely(x))" is excessive. WARN_ON() already uses unlikely()
> internally.
> 
> Signed-off-by: Zhongqiu Han <quic_zhonhan@quicinc.com>
> Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> ---
>  arch/riscv/kernel/signal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - riscv: signal: Remove unlikely() from WARN_ON() condition
    https://git.kernel.org/riscv/c/e1d96a07ba4b

You are awesome, thank you!
diff mbox series

Patch

diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c
index 5a2edd7f027e..dcd282419456 100644
--- a/arch/riscv/kernel/signal.c
+++ b/arch/riscv/kernel/signal.c
@@ -84,7 +84,7 @@  static long save_v_state(struct pt_regs *regs, void __user **sc_vec)
 	datap = state + 1;
 
 	/* datap is designed to be 16 byte aligned for better performance */
-	WARN_ON(unlikely(!IS_ALIGNED((unsigned long)datap, 16)));
+	WARN_ON(!IS_ALIGNED((unsigned long)datap, 16));
 
 	get_cpu_vector_context();
 	riscv_v_vstate_save(&current->thread.vstate, regs);