simple_strtoul is obsolete
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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);