Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae0246da authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman
Browse files

staging/lustre: Convert cfs_str2num_check to use kstrtoul



simple_strtoul is obsolete

Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4d8a00ef
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -229,17 +229,12 @@ 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)
		return 0;

	for (; endp < str + nob; endp++) {
		if (!isspace(*endp))
	rc = kstrtouint(str, 10, num);
	if (rc)
		return 0;
	}

	return (*num >= min && *num <= max);
}