]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/mm: hugepage_settings: use unsigned long in detect_hugetlb_page_size
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Mon, 11 May 2026 16:28:09 +0000 (19:28 +0300)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 21 Jun 2026 18:37:23 +0000 (11:37 -0700)
... instead of size_t to avoid type mismatch in 32 and 64 bit builds.

Link: https://lore.kernel.org/20260511162840.375890-26-rppt@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Tested-by: Luiz Capitulino <luizcap@redhat.com>
Tested-by: Sarthak Sharma <sarthak.sharma@arm.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Donet Tom <donettom@linux.ibm.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Liam Howlett <liam@infradead.org>
Cc: Li Wang <li.wang@linux.dev>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nico Pache <npache@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/cow.c
tools/testing/selftests/mm/gup_longterm.c
tools/testing/selftests/mm/hugepage_settings.c
tools/testing/selftests/mm/hugepage_settings.h
tools/testing/selftests/mm/uffd-wp-mremap.c

index 4321f4208fe392142fec0fbb6fd48d15882bcb93..5e571216b8d2ee2313a136118978d29f5018c143 100644 (file)
@@ -37,7 +37,7 @@ static size_t pmdsize;
 static int nr_thpsizes;
 static size_t thpsizes[20];
 static int nr_hugetlbsizes;
-static size_t hugetlbsizes[10];
+static unsigned long hugetlbsizes[10];
 static int gup_fd;
 static bool has_huge_zeropage;
 
index ab4eaf4feb7c0e47cfe805e96c3d86bf5f96f7d4..96dae0acd11af4139af7515572a1b7ae54f75671 100644 (file)
@@ -33,7 +33,7 @@
 
 static size_t pagesize;
 static int nr_hugetlbsizes;
-static size_t hugetlbsizes[10];
+static unsigned long hugetlbsizes[10];
 static int gup_fd;
 
 static __fsword_t get_fs_type(int fd)
index 3d6e4376de06af0a2491c715c95dd47738d97ffe..fa635667aabb991f24556048b196427a30ef93d7 100644 (file)
@@ -398,7 +398,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;
index 4c51e9219f6a09765832f3fcceca8a5ee605d56f..f49bd7fba51257481f8b537f7b8fa7a501511e0b 100644 (file)
@@ -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);
 
index 9d67b11c2f28705b7831db38bd2ca16bc2cec9c4..b44e02840a5e96bed6546f195156c06c3095fe0b 100644 (file)
 #include "uffd-common.h"
 
 static int pagemap_fd;
-static size_t pagesize;
 static int nr_pagesizes = 1;
+static unsigned long pagesize;
 static int nr_thpsizes;
 static size_t thpsizes[20];
 static int nr_hugetlbsizes;
-static size_t hugetlbsizes[10];
+static unsigned long hugetlbsizes[10];
 
 static int detect_thp_sizes(size_t sizes[], int max)
 {
@@ -245,7 +245,7 @@ out:
 }
 
 struct testcase {
-       size_t *sizes;
+       unsigned long *sizes;
        int *nr_sizes;
        bool private;
        bool swapout;