diff options
author | Andrew Jones <[email protected]> | 2023-04-26 16:13:33 +0200 |
---|---|---|
committer | Palmer Dabbelt <[email protected]> | 2023-04-26 08:58:34 -0700 |
commit | b09313dd2e726fe5e1fa574cd73f5e326c6030a4 (patch) | |
tree | e693bc28d2c000ca1e07d6c91444c6b19cabb4e2 | |
parent | 08dc107594681040587c23a097cfa678e51f5af2 (diff) |
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 <[email protected]>
Reviewed-by: Conor Dooley <[email protected]>
Reviewed-by: Evan Green <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>
-rw-r--r-- | arch/riscv/kernel/sys_riscv.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |