diff options
author | Yuntao Wang <ytcoode@gmail.com> | 2023-12-07 14:10:01 +0100 |
---|---|---|
committer | Mike Rapoport (IBM) <rppt@kernel.org> | 2023-12-08 09:31:00 +0100 |
commit | 2159bd4e905704b1765b6b883ea15e51ad986a6a (patch) | |
tree | a61f270a53d2266304fc0ff7baa105d6fdff98fe /mm/memblock.c | |
parent | Linux 6.7-rc4 (diff) | |
download | linux-2159bd4e905704b1765b6b883ea15e51ad986a6a.tar.xz linux-2159bd4e905704b1765b6b883ea15e51ad986a6a.zip |
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>
Diffstat (limited to 'mm/memblock.c')
-rw-r--r-- | mm/memblock.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memblock.c b/mm/memblock.c index 5a88d6d24d79..c1f579c23396 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1851,7 +1851,7 @@ int __init_memblock memblock_search_pfn_nid(unsigned long pfn, int mid = memblock_search(type, PFN_PHYS(pfn)); if (mid == -1) - return -1; + return NUMA_NO_NODE; *start_pfn = PFN_DOWN(type->regions[mid].base); *end_pfn = PFN_DOWN(type->regions[mid].base + type->regions[mid].size); |