mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
kstrtox: simpler code in _kstrtoull()
Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
01eda2e0c0
commit
78be959e38
1 changed files with 3 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue