Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1641198 > unrolled thread

[PATCH 1/2] kstrtox: delete end-of-string test

Started byAlexey Dobriyan <adobriyan@gmail.com>
First post2017-05-14 21:40 +0200
Last post2017-05-14 21:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] kstrtox: delete end-of-string test Alexey Dobriyan <adobriyan@gmail.com> - 2017-05-14 21:40 +0200

#1641198 — [PATCH 1/2] kstrtox: delete end-of-string test

FromAlexey Dobriyan <adobriyan@gmail.com>
Date2017-05-14 21:40 +0200
Subject[PATCH 1/2] kstrtox: delete end-of-string test
Message-ID<tH7wZ-5PJ-3@gated-at.bofh.it>
Standard "while (*s)" test is unnecessary because NUL won't pass
valid-digit test anyway. Save one branch per parsed character.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 lib/kstrtox.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 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')

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web