projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
01eda2e
)
kstrtox: simpler code in _kstrtoull()
author
Alexey Dobriyan
<adobriyan@gmail.com>
Thu, 14 Apr 2011 22:22:02 +0000
(15:22 -0700)
committer
Linus Torvalds
<torvalds@linux-foundation.org>
Thu, 14 Apr 2011 23:06:55 +0000
(16:06 -0700)
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>
lib/kstrtox.c
patch
|
blob
|
history
diff --git
a/lib/kstrtox.c
b/lib/kstrtox.c
index 05672e819f8c4c9164dd40e3752d23b8b5f63577..a235f3cc471c6d427fd4c2e713a701fa0b1e7e1b 100644
(file)
--- 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)