device-dax: Avoid an unnecessary check in alloc_dev_dax_range()
[linux-2.6-microblaze.git] / kernel / reboot.c
index e7b78d5..af6f23d 100644 (file)
@@ -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;