Skip to content

Commit a3c5eb8

Browse files
clementlegergregkh
authored andcommitted
riscv: cpufeature: use bitmap_equal() instead of memcmp()
commit c6ec1e1 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: 625034a ("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>
1 parent 4523396 commit a3c5eb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/cpufeature.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ static void __init riscv_resolve_isa(unsigned long *source_isa,
454454
if (bit < RISCV_ISA_EXT_BASE)
455455
*this_hwcap |= isa2hwcap[bit];
456456
}
457-
} while (loop && memcmp(prev_resolved_isa, resolved_isa, sizeof(prev_resolved_isa)));
457+
} while (loop && !bitmap_equal(prev_resolved_isa, resolved_isa, RISCV_ISA_EXT_MAX));
458458
}
459459

460460
static void __init match_isa_ext(const char *name, const char *name_end, unsigned long *bitmap)

0 commit comments

Comments
 (0)