Skip to content

Commit 08dc107

Browse files
Andrew Jonespalmer-dabbelt
authored andcommitted
RISC-V: hwprobe: There can only be one first
Only capture the first cpu_id in order for the comparison below to be of any use. Fixes: ea3de9c ("RISC-V: Add a syscall for HW probing") Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Evan Green <evan@rivosinc.com> Link: https://lore.kernel.org/r/20230426141333.10063-2-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 26e7aac commit 08dc107

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

arch/riscv/kernel/sys_riscv.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ static void hwprobe_arch_id(struct riscv_hwprobe *pair,
103103
break;
104104
}
105105

106-
if (first)
106+
if (first) {
107107
id = cpu_id;
108+
first = false;
109+
}
108110

109111
/*
110112
* If there's a mismatch for the given set, return -1 in the

0 commit comments

Comments
 (0)