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

From: Andy Shevchenko
Date: Sat May 27 2017 - 15:39:13 EST


On Sun, May 14, 2017 at 10:37 PM, Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:
> Standard "while (*s)" test is unnecessary because NUL won't pass
> valid-digit test anyway. Save one branch per parsed character.

> - while (*s) {
> + while (1) {

In such cases I prefer

do {} while ();

Since it makes easier to reader to catch that the loop is going at
least once (and less error prone (1) vs. (l) depending on font in
use).

...however, I see that patch is already applied.

--
With Best Regards,
Andy Shevchenko