diff options
Diffstat (limited to 'kernel/reboot.c')
| -rw-r--r-- | kernel/reboot.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/kernel/reboot.c b/kernel/reboot.c index 662c83fc16b7..a3a9e240fcdb 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c | |||
| @@ -388,15 +388,22 @@ static int __init reboot_setup(char *str) | |||
| 388 | break; | 388 | break; |
| 389 | 389 | ||
| 390 | case 's': | 390 | case 's': |
| 391 | if (isdigit(*(str+1))) | 391 | { |
| 392 | reboot_cpu = simple_strtoul(str+1, NULL, 0); | 392 | int rc; |
| 393 | else if (str[1] == 'm' && str[2] == 'p' && | 393 | |
| 394 | isdigit(*(str+3))) | 394 | if (isdigit(*(str+1))) { |
| 395 | reboot_cpu = simple_strtoul(str+3, NULL, 0); | 395 | rc = kstrtoint(str+1, 0, &reboot_cpu); |
| 396 | else | 396 | if (rc) |
| 397 | return rc; | ||
| 398 | } else if (str[1] == 'm' && str[2] == 'p' && | ||
| 399 | isdigit(*(str+3))) { | ||
| 400 | rc = kstrtoint(str+3, 0, &reboot_cpu); | ||
| 401 | if (rc) | ||
| 402 | return rc; | ||
| 403 | } else | ||
| 397 | reboot_mode = REBOOT_SOFT; | 404 | reboot_mode = REBOOT_SOFT; |
| 398 | break; | 405 | break; |
| 399 | 406 | } | |
| 400 | case 'g': | 407 | case 'g': |
| 401 | reboot_mode = REBOOT_GPIO; | 408 | reboot_mode = REBOOT_GPIO; |
| 402 | break; | 409 | break; |
