Re: [PATCH v15 02/12] lib: kstrtox: add local _parse_integer_limit_init() helper

From: Andy Shevchenko

Date: Wed Jun 03 2026 - 06:43:28 EST


On Wed, Jun 03, 2026 at 11:27:11AM +0100, Rodrigo Alencar wrote:
> On 26/06/02 10:43PM, Andy Shevchenko wrote:
> > On Sun, May 31, 2026 at 09:30:45AM +0100, Rodrigo Alencar via B4 Relay wrote:

...

> > > +static unsigned int _parse_integer_limit_init(const char *s, unsigned int base,
> > > + unsigned long long init,
> >
> > Why not name it res...
>
> "res" is short for result and this is an init value. I suppose the compiler
> can optmize towards that kinda of efficiency. I thought of "p" itself to
> carry the init value, and the function would just accumulate, but that would
> change expectations on the function behavior.

> > > + unsigned long long *p,
> > > + size_t max_chars)

In any case I hope you saw my mini-series:
20260602203706.103449-1-andriy.shevchenko@xxxxxxxxxxxxxxx

--
With Best Regards,
Andy Shevchenko