All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <kees@kernel.org>,
	"Darrick J . Wong" <djwong@kernel.org>,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3 2/3] lib/cmdline_kunit: add test case for memparse()
Date: Mon, 26 Jan 2026 18:41:17 +0200	[thread overview]
Message-ID: <aXeZLTs_rvEAMT2_@smile.fi.intel.com> (raw)
In-Reply-To: <20260126162059.357467-3-dmantipov@yandex.ru>

On Mon, Jan 26, 2026 at 07:20:58PM +0300, Dmitry Antipov wrote:
> Better late than never, now there is a long-awaited basic
> test for 'memparse()' which is provided by cmdline.c.

...

> +static const struct cmdline_test_memparse_entry testdata[] = {
> +	{ "0",				"",	0ULL },
> +	{ "1",				"",	1ULL },
> +	{ "a",				"a",	0ULL },
> +	{ "0xb",			"",	11ULL },
> +	{ "0xz",			"x",	0ULL },
> +	{ "1234",			"",	1234ULL },
> +	{ "04567",			"",	2423ULL },
> +	{ "0x9876",			"",	39030LL },
> +	{ "05678",			"8",	375ULL },
> +	{ "0xabcdefz",			"z",	11259375ULL },
> +	{ "0cdba",			"c",	0ULL },
> +	{ "4K",				"",	SZ_4K },
> +	{ "0x10k@0xaaaabbbb",		"@",	SZ_16K },
> +	{ "32M",			"",	SZ_32M },
> +	{ "067m:foo",			":",	55 * SZ_1M },
> +	{ "2G;bar=baz",			";",	SZ_2G },
> +	{ "07gz",			"z",	7ULL * SZ_1G },
> +	{ "3T+data",			"+",	3 * SZ_1T },
> +	{ "04t,ro",			",",	SZ_4T },
> +	{ "012p",			"",	11258999068426240ULL },
> +	{ "7P,sync",			",",	7881299347898368ULL },
> +	{ "0x2e",			"",	46ULL },
> +	{ "2E and more",		" ",	2305843009213693952ULL },

> +	{ "18446744073709551615", 	"",	ULLONG_MAX },
> +	{ "18446744073709551616", 	"",	ULLONG_MAX },
> +	{ "569202370375329612767", 	"",	ULLONG_MAX },

There are spaces left after first value in these three lines.

> +};

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-01-26 16:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26 16:20 [PATCH v3 0/3] lib and lib/cmdline enhancements Dmitry Antipov
2026-01-26 16:20 ` [PATCH v3 1/3] lib: fix _parse_integer_limit() to handle overflow Dmitry Antipov
2026-01-26 16:39   ` Andy Shevchenko
2026-01-26 16:20 ` [PATCH v3 2/3] lib/cmdline_kunit: add test case for memparse() Dmitry Antipov
2026-01-26 16:41   ` Andy Shevchenko [this message]
2026-01-26 16:20 ` [PATCH v3 3/3] lib/cmdline: adjust a few comments to fix kernel-doc -Wreturn warnings Dmitry Antipov
2026-01-26 16:43 ` [PATCH v3 0/3] lib and lib/cmdline enhancements Andy Shevchenko
2026-01-26 16:44   ` Andy Shevchenko

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=aXeZLTs_rvEAMT2_@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=djwong@kernel.org \
    --cc=dmantipov@yandex.ru \
    --cc=kees@kernel.org \
    --cc=linux-hardening@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.