Skip to content
Snippets Groups Projects
Commit 78be959e authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds
Browse files

kstrtox: simpler code in _kstrtoull()

parent 01eda2e0
No related branches found
No related tags found
No related merge requests found
......@@ -49,12 +49,9 @@ static int _kstrtoull(const char *s, unsigned int base, unsigned long long *res)
val = *s - '0';
else if ('a' <= _tolower(*s) && _tolower(*s) <= 'f')
val = _tolower(*s) - 'a' + 10;
else if (*s == '\n') {
if (*(s + 1) == '\0')
break;
else
return -EINVAL;
} else
else if (*s == '\n' && *(s + 1) == '\0')
break;
else
return -EINVAL;
if (val >= base)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment