Re: [PATCH v16 04/14] lib: kstrtox: add initial value to _parse_integer_limit()
From: Rodrigo Alencar
Date: Thu Jun 04 2026 - 06:18:13 EST
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.
> rv = 0;
> while (max_chars--) {
> unsigned int c = *s;
--
Kind regards,
Rodrigo Alencar