summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2011-04-14 15:22:02 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-14 16:06:55 -0700
commit78be959e38567f0e020848179a5d64d2b064391a (patch)
tree2b6b42edb8ba4f717db5d7a140c77d4993934f0d /lib
parent01eda2e0c0cf035308308a19581e4979285b51ec (diff)
downloadop-kernel-dev-78be959e38567f0e020848179a5d64d2b064391a.zip
op-kernel-dev-78be959e38567f0e020848179a5d64d2b064391a.tar.gz
kstrtox: simpler code in _kstrtoull()
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/kstrtox.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/kstrtox.c b/lib/kstrtox.c
index 05672e8..a235f3c 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)
OpenPOWER on IntegriCloud