[<prev] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXOddnWjwJxlVRIg@smile.fi.intel.com>
Date: Fri, 23 Jan 2026 18:10:30 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Dmitry Antipov <dmantipov@...dex.ru>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Kees Cook <kees@...nel.org>,
"Darrick J . Wong" <djwong@...nel.org>,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH v2 2/3] lib/cmdline_kunit: add test case for memparse()
On Fri, Jan 23, 2026 at 02:46:46PM +0300, Dmitry Antipov wrote:
> Better late than never, now there is a long-awaited basic
> test for 'memparse()' which is provided by cmdline.c.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...el.com>
Thanks!
Do not forget to carry on the tags, if needed.
...
> #include <linux/kernel.h>
> #include <linux/random.h>
> #include <linux/string.h>
> +#include <linux/sizes.h>
Preserve the order, sizes.h before string.h.
...
> +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@...aaabbbb", "@", 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 },
Seems like one more tab for the above to make the parameters on their columns
nicely.
> + { "18446744073709551615", "", ULLONG_MAX },
> + { "18446744073709551616", "", ULLONG_MAX },
> + { "569202370375329612767", "", ULLONG_MAX },
> +};
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists