summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorFabian Frederick2014-06-05 01:11:25 +0200
committerLinus Torvalds2014-06-05 01:54:15 +0200
commit616feab753972b9751308f3cd2a68fc57eae8edb (patch)
tree582eb03b5a22639a2776facf17e8c72f3d48dc22 /kernel
parentkernel/res_counter.c: replace simple_strtoull by kstrtoull (diff)
downloadkernel-qcow2-linux-616feab753972b9751308f3cd2a68fc57eae8edb.tar.gz
kernel-qcow2-linux-616feab753972b9751308f3cd2a68fc57eae8edb.tar.xz
kernel-qcow2-linux-616feab753972b9751308f3cd2a68fc57eae8edb.zip
kernel/reboot.c: convert simple_strtoul to kstrtoint
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/reboot.c21
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)
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;