diff options
author | David Rientjes <rientjes@google.com> | 2014-04-08 19:04:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-08 19:48:52 -0400 |
commit | d0057ca4c1fe73c05a9e077cc7691217370b3283 (patch) | |
tree | cf9fb38209bd853a1c5093347bd93d2ed6b031e0 /arch/x86/mm | |
parent | e39435ce68bb4685288f78b1a7e24311f7ef939f (diff) |
arch/x86/mm/kmemcheck/kmemcheck.c: use kstrtoint() instead of sscanf()
Kmemcheck should use the preferred interface for parsing command line
arguments, kstrto*(), rather than sscanf() itself. Use it
appropriately.
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Vegard Nossum <vegardno@ifi.uio.no>
Acked-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/kmemcheck/kmemcheck.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/mm/kmemcheck/kmemcheck.c b/arch/x86/mm/kmemcheck/kmemcheck.c index d87dd6d042d6..dd89a13f1051 100644 --- a/arch/x86/mm/kmemcheck/kmemcheck.c +++ b/arch/x86/mm/kmemcheck/kmemcheck.c | |||
@@ -78,10 +78,16 @@ early_initcall(kmemcheck_init); | |||
78 | */ | 78 | */ |
79 | static int __init param_kmemcheck(char *str) | 79 | static int __init param_kmemcheck(char *str) |
80 | { | 80 | { |
81 | int val; | ||
82 | int ret; | ||
83 | |||
81 | if (!str) | 84 | if (!str) |
82 | return -EINVAL; | 85 | return -EINVAL; |
83 | 86 | ||
84 | sscanf(str, "%d", &kmemcheck_enabled); | 87 | ret = kstrtoint(str, 0, &val); |
88 | if (ret) | ||
89 | return ret; | ||
90 | kmemcheck_enabled = val; | ||
85 | return 0; | 91 | return 0; |
86 | } | 92 | } |
87 | 93 | ||