linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/memblock.c: using judgment statement can reduce loop and enhance readability.
@ 2023-11-02  2:37 huanglllzu
  2023-11-02  8:54 ` Mike Rapoport
  0 siblings, 1 reply; 7+ messages in thread
From: huanglllzu @ 2023-11-02  2:37 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, akpm, rppt, Liangliang Huang, Liangliang Huang

From: Liangliang Huang <huangll@lemote.com>

Signed-off-by: Liangliang Huang <huangll@lemote.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



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-11-03  8:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-02  2:37 [PATCH] mm/memblock.c: using judgment statement can reduce loop and enhance readability huanglllzu
2023-11-02  8:54 ` Mike Rapoport
2023-11-03  3:19   ` 黄亮亮
2023-11-03  5:30   ` 黄亮亮
2023-11-03  7:34     ` Mike Rapoport
2023-11-03  8:21       ` 黄亮亮
2023-11-03  5:31   ` 黄亮亮

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).