Skip to content

Commit 1eb0a28

Browse files
RichardWeiYangrppt
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mike Rapoport (IBM) <[email protected]>
1 parent 1a87967 commit 1eb0a28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/memblock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ bool __init_memblock memblock_overlaps_region(struct memblock_type *type,
194194
for (i = 0; i < type->cnt; i++)
195195
if (memblock_addrs_overlap(base, size, type->regions[i].base,
196196
type->regions[i].size))
197-
break;
198-
return i < type->cnt;
197+
return true;
198+
return false;
199199
}
200200

201201
/**

0 commit comments

Comments
 (0)