Re: [PATCH v16 04/14] lib: kstrtox: add initial value to _parse_integer_limit()

From: Jonathan Cameron

Date: Wed Jun 24 2026 - 10:54:36 EST


On Sun, 14 Jun 2026 21:00:44 +0100
Jonathan Cameron <jic23@xxxxxxxxxx> wrote:

> 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.
I've done a mid merge cycle rebase as the char-misc branches have merged.
So this should be resolve on my testing branch now.

Thanks
Jonathan

>
> Jonathan
>
> > > rv = 0;
> > > while (max_chars--) {
> > > unsigned int c = *s;
> >
>
>