staging/lustre: Convert cfs_trace_daemon_command to use kstrtoul
authorOleg Drokin <green@linuxhacker.ru>
Tue, 16 Feb 2016 05:47:16 +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/tracefile.c

index c000baf09290d493d2a5a5c30d0019c7175596f5..ec3bc04bd89f2250889218ff0d5188a34d057698 100644 (file)
@@ -882,12 +882,15 @@ int cfs_trace_daemon_command(char *str)
                memset(cfs_tracefile, 0, sizeof(cfs_tracefile));
 
        } else if (strncmp(str, "size=", 5) == 0) {
-               cfs_tracefile_size = simple_strtoul(str + 5, NULL, 0);
-               if (cfs_tracefile_size < 10 || cfs_tracefile_size > 20480)
-                       cfs_tracefile_size = CFS_TRACEFILE_SIZE;
-               else
-                       cfs_tracefile_size <<= 20;
-
+               unsigned long tmp;
+
+               rc = kstrtoul(str + 5, 10, &tmp);
+               if (!rc) {
+                       if (tmp < 10 || tmp > 20480)
+                               cfs_tracefile_size = CFS_TRACEFILE_SIZE;
+                       else
+                               cfs_tracefile_size = tmp << 20;
+               }
        } else if (strlen(str) >= sizeof(cfs_tracefile)) {
                rc = -ENAMETOOLONG;
        } else if (str[0] != '/') {