Skip to content

Commit c6ec1e1

Browse files
clementlegerpalmer-dabbelt
authored andcommitted
riscv: cpufeature: use bitmap_equal() instead of memcmp()
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]>
1 parent fb8179c commit c6ec1e1

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
@@ -479,7 +479,7 @@ static void __init riscv_resolve_isa(unsigned long *source_isa,
479479
if (bit < RISCV_ISA_EXT_BASE)
480480
*this_hwcap |= isa2hwcap[bit];
481481
}
482-
} while (loop && memcmp(prev_resolved_isa, resolved_isa, sizeof(prev_resolved_isa)));
482+
} while (loop && !bitmap_equal(prev_resolved_isa, resolved_isa, RISCV_ISA_EXT_MAX));
483483
}
484484

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

0 commit comments

Comments
 (0)