From ae0246da1603be7e7374621741515c2b6f2d6332 Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Tue, 16 Feb 2016 00:47:17 -0500 Subject: [PATCH] staging/lustre: Convert cfs_str2num_check to use kstrtoul simple_strtoul is obsolete Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/libcfs/libcfs_string.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c index 09ab0e497a23..9dca666f825c 100644 --- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c @@ -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); -- 2.30.2