arch/x86/mm/kmemcheck/kmemcheck.c: use kstrtoint() instead of sscanf()
authorDavid Rientjes <rientjes@google.com>
Tue, 8 Apr 2014 23:04:13 +0000 (16:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Apr 2014 23:48:52 +0000 (16:48 -0700)
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>
arch/x86/mm/kmemcheck/kmemcheck.c

index d87dd6d042d64309fedac698dd1a5b28a8448594..dd89a13f1051adcb18d3565a495a7d34b63b4f5a 100644 (file)
@@ -78,10 +78,16 @@ early_initcall(kmemcheck_init);
  */
 static int __init param_kmemcheck(char *str)
 {
+       int val;
+       int ret;
+
        if (!str)
                return -EINVAL;
 
-       sscanf(str, "%d", &kmemcheck_enabled);
+       ret = kstrtoint(str, 0, &val);
+       if (ret)
+               return ret;
+       kmemcheck_enabled = val;
        return 0;
 }