]> git.ipfire.org Git - thirdparty/linux.git/commit
riscv: Simplify base extension checks and direct boolean return
authorChin Yik Ming <yikming2222@gmail.com>
Wed, 29 Jan 2025 20:38:43 +0000 (04:38 +0800)
committerAlexandre Ghiti <alexghiti@rivosinc.com>
Tue, 18 Mar 2025 12:47:20 +0000 (12:47 +0000)
commit7f238b12660e53d7905b0d9989866b95a32c2467
treea4f4f975e2326af206b547c9b287601ed5fee69b
parenta4a58f510bd8c28f6191eed5698a5291b420c2d6
riscv: Simplify base extension checks and direct boolean return

Reduce three lines checking to single line using a ternary conditional
expression for getting the base extension word. In addition, the
test_bit macro function already return a boolean which matches the
return type of the caller, so directly return the result of the test_bit
macro function.

Signed-off-by: Chin Yik Ming <yikming2222@gmail.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20250129203843.1136838-1-yikming2222@gmail.com
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
arch/riscv/kernel/cpufeature.c
arch/riscv/kernel/vendor_extensions.c