diff options
author | Wei Yang <richard.weiyang@gmail.com> | 2024-05-07 09:58:31 +0200 |
---|---|---|
committer | Mike Rapoport (IBM) <rppt@kernel.org> | 2024-06-05 09:22:22 +0200 |
commit | 1eb0a28d039a479bb4adec0320592caf5bd5175b (patch) | |
tree | 694df720b9734160e4eabf2247b324750d4d84cc /mm/memblock.c | |
parent | memblock tests: add memblock_overlaps_region_checks (diff) | |
download | linux-1eb0a28d039a479bb4adec0320592caf5bd5175b.tar.xz linux-1eb0a28d039a479bb4adec0320592caf5bd5175b.zip |
mm/memblock: return true directly on finding overlap region
Not necessary to break and check i against type->cnt again.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Link: https://lore.kernel.org/r/20240507075833.6346-6-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | mm/memblock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memblock.c b/mm/memblock.c index 7f3cd96d6769..da9a6c862a69 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -194,8 +194,8 @@ bool __init_memblock memblock_overlaps_region(struct memblock_type *type, for (i = 0; i < type->cnt; i++) if (memblock_addrs_overlap(base, size, type->regions[i].base, type->regions[i].size)) - break; - return i < type->cnt; + return true; + return false; } /** |