From: Andrew Morton <akpm@linux-foundation.org>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Carlos Maiolino <cem@kernel.org>,
Christoph Hellwig <hch@infradead.org>,
Kees Cook <kees@kernel.org>, Andy Shevchenko <andy@kernel.org>,
linux-xfs@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] lib: introduce simple error-checking wrapper for memparse()
Date: Wed, 7 Jan 2026 10:48:02 -0800 [thread overview]
Message-ID: <20260107104802.91735989425034c858730b8f@linux-foundation.org> (raw)
In-Reply-To: <20260107183614.782245-1-dmantipov@yandex.ru>
On Wed, 7 Jan 2026 21:36:13 +0300 Dmitry Antipov <dmantipov@yandex.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?
next prev parent reply other threads:[~2026-01-07 18:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-07 18:36 [PATCH] lib: introduce simple error-checking wrapper for memparse() Dmitry Antipov
2026-01-07 18:36 ` [PATCH v2] xfs: adjust handling of a few numerical mount options Dmitry Antipov
2026-01-07 18:48 ` Andrew Morton [this message]
2026-01-08 13:14 ` [PATCH] lib: introduce simple error-checking wrapper for memparse() Dmitry Antipov
2026-01-07 19:22 ` Andy Shevchenko
2026-01-07 19:24 ` Andy Shevchenko
2026-01-07 20:08 ` Kees Cook
2026-01-08 9:31 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260107104802.91735989425034c858730b8f@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=andy@kernel.org \
--cc=cem@kernel.org \
--cc=dmantipov@yandex.ru \
--cc=hch@infradead.org \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox