public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: cpufeature: use bitmap_equal() instead of memcmp()
@ 2025-02-10 15:56 Clément Léger
  2025-02-11  7:41 ` Alexandre Ghiti
  2025-02-13 18:30 ` patchwork-bot+linux-riscv
  0 siblings, 2 replies; 4+ messages in thread
From: Clément Léger @ 2025-02-10 15:56 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, open list:RISC-V ARCHITECTURE,
	open list
  Cc: Clément Léger, Conor Dooley, Alexandre Ghiti

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>
---
 arch/riscv/kernel/cpufeature.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index c6ba750536c3..40ac72e407b6 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -479,7 +479,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)
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-13 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10 15:56 [PATCH] riscv: cpufeature: use bitmap_equal() instead of memcmp() Clément Léger
2025-02-11  7:41 ` Alexandre Ghiti
2025-02-11  8:15   ` Clément Léger
2025-02-13 18:30 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox