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

From: Rodrigo Alencar

Date: Wed Jun 03 2026 - 06:48:24 EST


On 26/06/03 01:40PM, Andy Shevchenko wrote:
> 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

I did. It looks good and it fits well here. Although I suppose that would delay
this one bit more.

--
Kind regards,

Rodrigo Alencar