]> Git Repo - J-linux.git/commitdiff
RISC-V: hwprobe: There can only be one first
authorAndrew Jones <[email protected]>
Wed, 26 Apr 2023 14:13:32 +0000 (16:13 +0200)
committerPalmer Dabbelt <[email protected]>
Wed, 26 Apr 2023 15:58:33 +0000 (08:58 -0700)
Only capture the first cpu_id in order for the comparison
below to be of any use.

Fixes: ea3de9ce8aa2 ("RISC-V: Add a syscall for HW probing")
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]>
arch/riscv/kernel/sys_riscv.c

index 849b4170629dc566e0322bbf0068ee019a3de1ea..c569dac7452eef32889001713697d9ebbf2269f2 100644 (file)
@@ -103,8 +103,10 @@ static void hwprobe_arch_id(struct riscv_hwprobe *pair,
                        break;
                }
 
-               if (first)
+               if (first) {
                        id = cpu_id;
+                       first = false;
+               }
 
                /*
                 * If there's a mismatch for the given set, return -1 in the
This page took 0.047328 seconds and 4 git commands to generate.