Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[cascardo/linux.git] / kernel / reboot.c
index 662c83f..a3a9e24 100644 (file)
@@ -388,15 +388,22 @@ static int __init reboot_setup(char *str)
                        break;
 
                case 's':
-                       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
+               {
+                       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
                                reboot_mode = REBOOT_SOFT;
                        break;
-
+               }
                case 'g':
                        reboot_mode = REBOOT_GPIO;
                        break;