Skip to content

Commit d9ac689

Browse files
clementlegermehmetb0
authored andcommitted
riscv: cpufeature: use bitmap_equal() instead of memcmp()
BugLink: https://bugs.launchpad.net/bugs/2106703 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 <[email protected]> Fixes: 625034a ("riscv: add ISA extensions validation callback") Reviewed-by: Alexandre Ghiti <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Noah Wager <[email protected]> Signed-off-by: Mehmet Basaran <[email protected]>
1 parent 37c23cc commit d9ac689

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
@@ -453,7 +453,7 @@ static void __init riscv_resolve_isa(unsigned long *source_isa,
453453
if (bit < RISCV_ISA_EXT_BASE)
454454
*this_hwcap |= isa2hwcap[bit];
455455
}
456-
} while (loop && memcmp(prev_resolved_isa, resolved_isa, sizeof(prev_resolved_isa)));
456+
} while (loop && !bitmap_equal(prev_resolved_isa, resolved_isa, RISCV_ISA_EXT_MAX));
457457
}
458458

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

0 commit comments

Comments
 (0)