summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2017-07-10 15:51:38 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-10 16:32:34 -0700
commit512750ef8b06290a55d749239f956f9c21d7daca (patch)
tree49711b54762ea95db401991725eeb1f709b1d5fa
parent2c6deb01525ac11cc03c44fe31e3f45ce2cadaf9 (diff)
downloadlinux-512750ef8b06290a55d749239f956f9c21d7daca.tar.gz
linux-512750ef8b06290a55d749239f956f9c21d7daca.tar.bz2
linux-512750ef8b06290a55d749239f956f9c21d7daca.zip
lib/kstrtox.c: delete end-of-string test
Standard "while (*s)" test is unnecessary because NUL won't pass valid-digit test anyway. Save one branch per parsed character. Link: http://lkml.kernel.org/r/20170514193756.GA32563@avx2 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>
-rw-r--r--lib/kstrtox.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kstrtox.c b/lib/kstrtox.c
index bf85e05ce858..90013f4841c7 100644
--- a/lib/kstrtox.c
+++ b/lib/kstrtox.c
@@ -51,7 +51,7 @@ unsigned int _parse_integer(const char *s, unsigned int base, unsigned long long
res = 0;
rv = 0;
- while (*s) {
+ while (1) {
unsigned int val;
if ('0' <= *s && *s <= '9')