diff mbox series

[v2,6/8] mm/memblock: return true directly on finding overlap region

Message ID 20240425071929.18004-7-richard.weiyang@gmail.com (mailing list archive)
State New
Headers show
Series memblock: clenup | expand

Commit Message

Wei Yang April 25, 2024, 7:19 a.m. UTC
Not necessary to break and check i against type->cnt again.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 mm/memblock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/mm/memblock.c b/mm/memblock.c
index 53e3aa2cd9a2..4125506d8af9 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;
 }
 
 /**