Re: [PATCH 3/3] tools/mm/page-types: Fix kpageflags option argument in getopt_long
From: David Hildenbrand (Arm)
Date: Wed May 13 2026 - 06:27:43 EST
On 5/13/26 04:21, Ye Liu wrote:
> From: Ye Liu <liuye@xxxxxxxxxx>
>
> The --kpageflags option requires an argument to specify the kpageflags
> file path, but has_arg was set to 0 (no_argument) in the long options
> table. Change it to 1 (required_argument) so getopt_long correctly
> parses the argument.
>
> Signed-off-by: Ye Liu <liuye@xxxxxxxxxx>
> ---
> tools/mm/page-types.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/mm/page-types.c b/tools/mm/page-types.c
> index 66f429f2b698..7fc5a8be5997 100644
> --- a/tools/mm/page-types.c
> +++ b/tools/mm/page-types.c
> @@ -1261,7 +1261,7 @@ static const struct option opts[] = {
> { "no-summary", 0, NULL, 'N' },
> { "hwpoison" , 0, NULL, 'X' },
> { "unpoison" , 0, NULL, 'x' },
> - { "kpageflags", 0, NULL, 'F' },
> + { "kpageflags", 1, NULL, 'F' },
> { "help" , 0, NULL, 'h' },
> { NULL , 0, NULL, 0 }
> };
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David