Re: [PATCH v3 1/2] lib: introduce simple error-checking wrapper for memparse()

Andy Shevchenko
2026-01-08T20:06:04Z

On Thu, Jan 08, 2026 at 07:52:15PM +0300, Dmitry Antipov wrote:
> Introduce 'memvalue()' which uses 'memparse()' to parse a string
> with optional memory suffix into a non-negative number. If parsing
> has succeeded, returns 0 and stores the result at the location
> specified by the second argument. Otherwise returns -EINVAL and
> leaves the location untouched.

...

> +/**
> + * memvalue - Wrap memparse() with simple error detection
> + * @ptr: Where parse begins
> + * @valptr: Where to store result
> + *
> + * Unconditionally returns -EINVAL for a presumably negative value.
> + * Otherwise uses memparse() to parse a string into a number stored
> + * at @valptr and returns 0 or -EINVAL if an unrecognized character
> + * was encountered. For a non-zero return value, memory at @valptr
> + * is left untouched.
> + */

There are two problems with this kernel-doc:
1) inherited one with strange indentation;
2) missing Return section (run kernel-doc validator with -Wreturn, for example).

--
With Best Regards,
Andy Shevchenko