[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231102023710.13023-1-huanglllzu@gmail.com>
Date: Thu, 2 Nov 2023 10:37:10 +0800
From: huanglllzu@...il.com
To: linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
rppt@...nel.org, Liangliang Huang <huanglllzu@...il.com>,
Liangliang Huang <huangll@...ote.com>
Subject: [PATCH] mm/memblock.c: using judgment statement can reduce loop and enhance readability.
From: Liangliang Huang <huangll@...ote.com>
Signed-off-by: Liangliang Huang <huangll@...ote.com>
---
mm/memblock.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index 913b2520a9a0..e48dea7144bb 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -655,7 +655,11 @@ static int __init_memblock memblock_add_range(struct memblock_type *type,
}
}
/* area below @rend is dealt with, forget about it */
- base = min(rend, end);
+ if (end < rend) {
+ base = end;
+ break;
+ } else
+ base = rend;
}
/* insert the remaining portion */
--
2.25.1
Powered by blists - more mailing lists