linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kstrtox: delete end-of-string test
@ 2017-05-14 19:37 Alexey Dobriyan
  2017-05-27 19:39 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2017-05-14 19:37 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-27 19:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-14 19:37 [PATCH 1/2] kstrtox: delete end-of-string test Alexey Dobriyan
2017-05-27 19:39 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).