提交 78be959e 编写于 作者: A Alexey Dobriyan 提交者: Linus Torvalds

kstrtox: simpler code in _kstrtoull()

Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 01eda2e0
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册