[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260107104802.91735989425034c858730b8f@linux-foundation.org>
Date: Wed, 7 Jan 2026 10:48:02 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Dmitry Antipov <dmantipov@...dex.ru>
Cc: Carlos Maiolino <cem@...nel.org>, Christoph Hellwig <hch@...radead.org>,
Kees Cook <kees@...nel.org>, Andy Shevchenko <andy@...nel.org>,
linux-xfs@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] lib: introduce simple error-checking wrapper for
memparse()
On Wed, 7 Jan 2026 21:36:13 +0300 Dmitry Antipov <dmantipov@...dex.ru> wrote:
> Introduce 'memvalue()' which uses 'memparse()' to parse a string with
> optional memory suffix into a number and returns this number or ULLONG_MAX
> if the number is negative or an unrecognized character was encountered.
I'm not understanding why negative numbers get this treatment - could
you please add the reasoning to the code comment?
Presumably it's because memvalue() returns ULL, presumably because
memparse() returns ULL? Maybe that's all wrong, and memparse() should
have returned LL - negative numbers are a bit odd, but why deny that
option. With the new memvalue() we get to partially address that?
Powered by blists - more mailing lists