aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Drokin <[email protected]>2016-02-16 00:47:16 -0500
committerGreg Kroah-Hartman <[email protected]>2016-02-20 14:33:11 -0800
commit4d8a00ef544af38af91f4fc2fcfe62bfa6d94e90 (patch)
tree0b7d144b6b31f17a4d70986a6787f1c144279d8b
parent3e1f3db1b29bc8eb6f22c0bb17a4650d13a64f1a (diff)
staging/lustre: Convert cfs_trace_daemon_command to use kstrtoul
simple_strtoul is obsolete Signed-off-by: Oleg Drokin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/lustre/lustre/libcfs/tracefile.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c
index c000baf09290..ec3bc04bd89f 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c
@@ -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] != '/') {