From: Alexey Dobriyan Date: Mon, 10 Jul 2017 22:51:38 +0000 (-0700) Subject: lib/kstrtox.c: delete end-of-string test X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=512750ef8b06290a55d749239f956f9c21d7daca;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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')