]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
kernel/reboot.c: convert simple_strtoul to kstrtoint
authorFabian Frederick <fabf@skynet.be>
Wed, 4 Jun 2014 23:11:25 +0000 (16:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Jun 2014 23:54:15 +0000 (16:54 -0700)
Replace obsolete function.
kstrtoint is used as reboot_cpu is an integer.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/reboot.c

index 662c83fc16b77ed79b9474c681848858666055e0..a3a9e240fcdba6662b5cccfe0e1f283a70910ffd 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;