summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Léger <cleger@rivosinc.com>2025-02-10 16:56:14 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-07 18:27:14 +0100
commit80aca44bf5aef32dbec6a3a36b2eb3cf5569ab4c (patch)
tree4fc4c22b20622074fa6d0d77f3fcdea6370cb35c
parent87ba35b7a35382438c591249e9e824e5a1336075 (diff)
riscv: cpufeature: use bitmap_equal() instead of memcmp()
commit c6ec1e1b078d8e2ecd075e46db6197a14930a3fc upstream. Comparison of bitmaps should be done using bitmap_equal(), not memcmp(), use the former one to compare isa bitmaps. Signed-off-by: Clément Léger <cleger@rivosinc.com> Fixes: 625034abd52a8c ("riscv: add ISA extensions validation callback") Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20250210155615.1545738-1-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/riscv/kernel/cpufeature.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index c0916ed318c2..aaf5fa57591b 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -475,7 +475,7 @@ static void __init riscv_resolve_isa(unsigned long *source_isa,
if (bit < RISCV_ISA_EXT_BASE)
*this_hwcap |= isa2hwcap[bit];
}
- } while (loop && memcmp(prev_resolved_isa, resolved_isa, sizeof(prev_resolved_isa)));
+ } while (loop && !bitmap_equal(prev_resolved_isa, resolved_isa, RISCV_ISA_EXT_MAX));
}
static void __init match_isa_ext(const char *name, const char *name_end, unsigned long *bitmap)