From: Alexey Dobriyan Date: Thu, 14 Apr 2011 22:22:02 +0000 (-0700) Subject: kstrtox: simpler code in _kstrtoull() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=78be959e38567f0e020848179a5d64d2b064391a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git kstrtox: simpler code in _kstrtoull() Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/kstrtox.c b/lib/kstrtox.c index 05672e819f8c..a235f3cc471c 100644 --- a/lib/kstrtox.c +++ b/lib/kstrtox.c @@ -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)