]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: checksum: Use riscv_has_extension_likely
authorVivian Wang <wangruikang@iscas.ac.cn>
Tue, 18 Nov 2025 04:19:21 +0000 (21:19 -0700)
committerPaul Walmsley <pjw@kernel.org>
Wed, 19 Nov 2025 16:19:27 +0000 (09:19 -0700)
commit1c7d491d8678ee056ee91de5cb14c9afa50175cb
tree75457be3a30051e106335ab51a9db03113ac3ff6
parent0a067ae21bf26e245f2687ef24cfb7302393a8a0
riscv: checksum: Use riscv_has_extension_likely

Use riscv_has_extension_likely() to check for RISCV_ISA_EXT_ZBB,
replacing the use of asm goto with ALTERNATIVE.

The "likely" variant is used to match the behavior of the original
implementation using ALTERNATIVE("j %l[no_zbb]", "nop", ...).

While we're at it, also remove bogus comment about Zbb being likely
available. We have to choose between "likely" and "unlikely" due to
limitations of the asm goto feature, but that does not mean we should
put a bad comment on why we pick "likely" over "unlikely".

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
Link: https://patch.msgid.link/20251020-riscv-altn-helper-wip-v4-2-ef941c87669a@iscas.ac.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/include/asm/checksum.h
arch/riscv/lib/csum.c