Re: [PATCH v16 04/14] lib: kstrtox: add initial value to _parse_integer_limit()
From: Jonathan Cameron
Date: Sun Jun 14 2026 - 16:01:28 EST
On Thu, 4 Jun 2026 11:09:33 +0100
Rodrigo Alencar <455.rodrigo.alencar@xxxxxxxxx> wrote:
> On 26/06/04 10:58AM, Rodrigo Alencar via B4 Relay wrote:
> > From: Rodrigo Alencar <rodrigo.alencar@xxxxxxxxxx>
> >
> > Add init parameter to _parse_integer_limit() that defines an initial
> > value for the accumulated result when parsing an 64-bit integer. The
> > new function prototype is adjusted so that the _parse_integer() macros
> > stay consistent allowing for one more argument, which defaults to 0.
>
> ...
>
> > noinline
> > unsigned int _parse_integer_limit(const char *s, unsigned int base, unsigned long long *p,
> > - size_t max_chars)
> > + size_t max_chars, unsigned long long init)
> > {
> > unsigned long long res;
> > unsigned int rv;
> >
> > - res = 0;
> > + res = init;
>
> This might generate conflict, as the code around have changed in linux-next.
> It is an easy fix though.
>
Thanks for the heads up. Hopefully that will all fall out when I rebase testing
on rc1 once that is out.
Jonathan
> > rv = 0;
> > while (max_chars--) {
> > unsigned int c = *s;
>