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>
This commit is contained in:
Wei Yang 2024-05-07 07:58:31 +00:00 committed by Mike Rapoport (IBM)
parent 1a879671bd
commit 1eb0a28d03

View File

@ -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;
}
/**