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

Dmitry Antipov
2026-01-09T11:05:50Z

On Thu, 2026-01-08 at 22:10 +0200, Andy Shevchenko wrote:

> Hmm... Why not -ERANGE (IIRC this what kstrto*() returns when it doesn't match
> the given range).

Well, I've always treated -ERANGE closer to formal math, i.e. "return -ERANGE
if X is not in [A:B)", rather than using it to denote something which makes
no practical sense in some particular context, like negative amount of memory
or negative string length.

Dmitry