staging/lustre: Convert cfs_str2num_check to use kstrtoul
authorOleg Drokin <green@linuxhacker.ru>
Tue, 16 Feb 2016 05:47:17 +0000 (00:47 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 22:33:11 +0000 (14:33 -0800)
simple_strtoul is obsolete

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/libcfs_string.c

index 09ab0e4..9dca666 100644 (file)
@@ -229,18 +229,13 @@ int
 cfs_str2num_check(char *str, int nob, unsigned *num,
                  unsigned min, unsigned max)
 {
-       char    *endp;
+       int rc;
 
        str = cfs_trimwhite(str);
-       *num = simple_strtoul(str, &endp, 0);
-       if (endp == str)
+       rc = kstrtouint(str, 10, num);
+       if (rc)
                return 0;
 
-       for (; endp < str + nob; endp++) {
-               if (!isspace(*endp))
-                       return 0;
-       }
-
        return (*num >= min && *num <= max);
 }
 EXPORT_SYMBOL(cfs_str2num_check);