diff options
| author | Mark Brown <broonie@kernel.org> | 2020-12-11 17:49:01 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2020-12-11 17:49:01 +0000 |
| commit | 3e98a021cc85e7d52acdd1eae8a988e975ec5bf9 (patch) | |
| tree | cecfac58b9550a602555a02a9d583ed0f3378b38 /kernel/reboot.c | |
| parent | 58f7553fa424fd0fd74e8b796d50c66014cebebe (diff) | |
| parent | 2fee9583198eb97b5351feda7bd825e0f778385c (diff) | |
Merge remote-tracking branch 'spi/for-5.11' into spi-next
Diffstat (limited to 'kernel/reboot.c')
| -rw-r--r-- | kernel/reboot.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/kernel/reboot.c b/kernel/reboot.c index e7b78d5ae1ab..af6f23d8bea1 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -551,22 +551,22 @@ static int __init reboot_setup(char *str) break; case 's': - { - int rc; - - if (isdigit(*(str+1))) { - rc = kstrtoint(str+1, 0, &reboot_cpu); - if (rc) - return rc; - } else if (str[1] == 'm' && str[2] == 'p' && - isdigit(*(str+3))) { - rc = kstrtoint(str+3, 0, &reboot_cpu); - if (rc) - return rc; - } else + if (isdigit(*(str+1))) + reboot_cpu = simple_strtoul(str+1, NULL, 0); + else if (str[1] == 'm' && str[2] == 'p' && + isdigit(*(str+3))) + reboot_cpu = simple_strtoul(str+3, NULL, 0); + else *mode = REBOOT_SOFT; + if (reboot_cpu >= num_possible_cpus()) { + pr_err("Ignoring the CPU number in reboot= option. " + "CPU %d exceeds possible cpu number %d\n", + reboot_cpu, num_possible_cpus()); + reboot_cpu = 0; + break; + } break; - } + case 'g': *mode = REBOOT_GPIO; break; |
