Skip to content

Commit 2159bd4

Browse files
ytcooderppt
authored andcommitted
memblock: Return NUMA_NO_NODE instead of -1 to improve code readability
When no corresponding memory region is found for the given pfn, return NUMA_NO_NODE instead of -1. This improves code readability and aligns with the existing logic of the memblock_search_pfn_nid() function's user. Signed-off-by: Yuntao Wang <ytcoode@gmail.com> Link: https://lore.kernel.org/r/20231207131001.224914-1-ytcoode@gmail.com Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
1 parent 33cc938 commit 2159bd4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mm/memblock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,7 @@ int __init_memblock memblock_search_pfn_nid(unsigned long pfn,
18511851
int mid = memblock_search(type, PFN_PHYS(pfn));
18521852

18531853
if (mid == -1)
1854-
return -1;
1854+
return NUMA_NO_NODE;
18551855

18561856
*start_pfn = PFN_DOWN(type->regions[mid].base);
18571857
*end_pfn = PFN_DOWN(type->regions[mid].base + type->regions[mid].size);

0 commit comments

Comments
 (0)