Re: [PATCH v3 24/54] selftests/mm: hugepage_settings: use unsigned long in detect_hugetlb_page_size

Sarthak Sharma
2026-05-06T09:25:06Z

On 4/29/26 2:12 AM, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
>
> ... instead of size_t to avoid type mismatch in 32 and 64 bit builds.
>
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

Looks good to me.

Reviewed-by: Sarthak Sharma <sarthak.sharma@arm.com>

> ---
> tools/testing/selftests/mm/hugepage_settings.c | 2 +-
> tools/testing/selftests/mm/hugepage_settings.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/hugepage_settings.c b/tools/testing/selftests/mm/hugepage_settings.c
> index ebaa621c45c6..8f563315b1fc 100644
> --- a/tools/testing/selftests/mm/hugepage_settings.c
> +++ b/tools/testing/selftests/mm/hugepage_settings.c
> @@ -399,7 +399,7 @@ bool thp_is_enabled(void)
> return mode == 1 || mode == 3;
> }
>
> -int detect_hugetlb_page_sizes(size_t sizes[], int max)
> +int detect_hugetlb_page_sizes(unsigned long sizes[], int max)
> {
> DIR *dir = opendir("/sys/kernel/mm/hugepages/");
> int count = 0;
> diff --git a/tools/testing/selftests/mm/hugepage_settings.h b/tools/testing/selftests/mm/hugepage_settings.h
> index 320b97e768e8..9357d07e6c1b 100644
> --- a/tools/testing/selftests/mm/hugepage_settings.h
> +++ b/tools/testing/selftests/mm/hugepage_settings.h
> @@ -90,7 +90,7 @@ bool thp_is_enabled(void);
>
> /* HugeTLB */
>
> -int detect_hugetlb_page_sizes(size_t sizes[], int max);
> +int detect_hugetlb_page_sizes(unsigned long sizes[], int max);
> unsigned long default_huge_page_size(void);
> unsigned long get_free_hugepages(void);
>