All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 088/115] lib/kstrtox.c: delete end-of-string test
@ 2017-07-10 22:51 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-07-10 22:51 UTC (permalink / raw)
  To: adobriyan, akpm, mm-commits, torvalds

From: Alexey Dobriyan <adobriyan@gmail.com>
Subject: 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>
---

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

diff -puN lib/kstrtox.c~kstrtox-delete-end-of-string-test lib/kstrtox.c
--- a/lib/kstrtox.c~kstrtox-delete-end-of-string-test
+++ a/lib/kstrtox.c
@@ -51,7 +51,7 @@ unsigned int _parse_integer(const char *
 
 	res = 0;
 	rv = 0;
-	while (*s) {
+	while (1) {
 		unsigned int val;
 
 		if ('0' <= *s && *s <= '9')
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-10 22:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-10 22:51 [patch 088/115] lib/kstrtox.c: delete end-of-string test akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.