diff mbox series

[2/2] RISC-V: hwprobe: Explicity check for -1 in vdso init

Message ID 20230426141333.10063-3-ajones@ventanamicro.com (mailing list archive)
State Accepted
Headers show
Series RISC-V: hwprobe: Couple fixes found on late review | expand

Checks

Context Check Description
conchuod/tree_selection fail Failed to apply to next/pending-fixes or riscv/for-next

Commit Message

Andrew Jones April 26, 2023, 2:13 p.m. UTC
id_bitsmash is unsigned. We need to explicitly check for -1, rather
than use > 0.

Fixes: aa5af0aa90ba ("RISC-V: Add hwprobe vDSO function and data")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
---
 arch/riscv/kernel/sys_riscv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c
index c569dac7452e..5db29683ebee 100644
--- a/arch/riscv/kernel/sys_riscv.c
+++ b/arch/riscv/kernel/sys_riscv.c
@@ -282,7 +282,7 @@  static int __init init_hwprobe_vdso_data(void)
 	 * populated) or any value returns -1 (varies across CPUs), then the
 	 * vDSO should defer to the kernel for exotic cpu masks.
 	 */
-	avd->homogeneous_cpus = (id_bitsmash > 0);
+	avd->homogeneous_cpus = id_bitsmash != 0 && id_bitsmash != -1;
 	return 0;
 }