diff options
| -rw-r--r-- | arch/riscv/kernel/smpboot.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index cfb0b02db647..4a232600cedb 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c | |||
| @@ -50,7 +50,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 50 | void __init setup_smp(void) | 50 | void __init setup_smp(void) |
| 51 | { | 51 | { |
| 52 | struct device_node *dn = NULL; | 52 | struct device_node *dn = NULL; |
| 53 | int hart, im_okay_therefore_i_am = 0; | 53 | int hart; |
| 54 | bool found_boot_cpu = false; | ||
| 54 | 55 | ||
| 55 | while ((dn = of_find_node_by_type(dn, "cpu"))) { | 56 | while ((dn = of_find_node_by_type(dn, "cpu"))) { |
| 56 | hart = riscv_of_processor_hartid(dn); | 57 | hart = riscv_of_processor_hartid(dn); |
| @@ -58,13 +59,13 @@ void __init setup_smp(void) | |||
| 58 | set_cpu_possible(hart, true); | 59 | set_cpu_possible(hart, true); |
| 59 | set_cpu_present(hart, true); | 60 | set_cpu_present(hart, true); |
| 60 | if (hart == smp_processor_id()) { | 61 | if (hart == smp_processor_id()) { |
| 61 | BUG_ON(im_okay_therefore_i_am); | 62 | BUG_ON(found_boot_cpu); |
| 62 | im_okay_therefore_i_am = 1; | 63 | found_boot_cpu = true; |
| 63 | } | 64 | } |
| 64 | } | 65 | } |
| 65 | } | 66 | } |
| 66 | 67 | ||
| 67 | BUG_ON(!im_okay_therefore_i_am); | 68 | BUG_ON(!found_boot_cpu); |
| 68 | } | 69 | } |
| 69 | 70 | ||
| 70 | int __cpu_up(unsigned int cpu, struct task_struct *tidle) | 71 | int __cpu_up(unsigned int cpu, struct task_struct *tidle) |
