selftests/mm/vm_util.c: correct __pagemap_scan_get_categories return value

Currently __pagemap_scan_get_categories returns the result from the ioctl
call which should be an int, not uint64_t.  The ioctl may return -1 on
error, which will be interpreted as UINT64_MAX.  Adjust the return type to
use the correct value.

Link: https://lore.kernel.org/20260806150339.1824251-2-audra@redhat.com
Signed-off-by: Audra Mitchell <audra@redhat.com>
Reviewed-by: Liam R. Howlett (Oracle) <liam@infradead.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Audra Mitchell
2026-08-06 11:00:34 -04:00
committed by Andrew Morton
parent 54cc9b3847
commit dc924f0f85

View File

@@ -34,7 +34,7 @@ uint64_t pagemap_get_entry(int fd, char *start)
return entry;
}
static uint64_t __pagemap_scan_get_categories(int fd, char *start, struct page_region *r)
static int __pagemap_scan_get_categories(int fd, char *start, struct page_region *r)
{
struct pm_scan_arg arg;
@@ -58,7 +58,7 @@ static uint64_t __pagemap_scan_get_categories(int fd, char *start, struct page_r
static uint64_t pagemap_scan_get_categories(int fd, char *start)
{
struct page_region r;
long ret;
int ret;
ret = __pagemap_scan_get_categories(fd, start, &r);
if (ret < 0)