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 <[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]>
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)