From 1eb0a28d039a479bb4adec0320592caf5bd5175b Mon Sep 17 00:00:00 2001 From: Wei Yang Date: Tue, 7 May 2024 07:58:31 +0000 Subject: 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 Link: https://lore.kernel.org/r/20240507075833.6346-6-richard.weiyang@gmail.com Signed-off-by: Mike Rapoport (IBM) --- mm/memblock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mm/memblock.c') 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; } /** -- cgit v1.2.3