From: Andrew Jones Date: Wed, 26 Apr 2023 14:13:33 +0000 (+0200) Subject: RISC-V: hwprobe: Explicity check for -1 in vdso init X-Git-Tag: v6.6.17~4974^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b09313dd2e726fe5e1fa574cd73f5e326c6030a4;p=platform%2Fkernel%2Flinux-rpi.git RISC-V: hwprobe: Explicity check for -1 in vdso init 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 Reviewed-by: Conor Dooley Reviewed-by: Evan Green Link: https://lore.kernel.org/r/20230426141333.10063-3-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt --- diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c index c569dac..5db2968 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; }