From: zenghongling <zenghongling@kylinos.cn>
To: akpm@linux-foundation.org, david@kernel.org,
lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
mhocko@suse.com
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
zhongling0719@126.com, zenghongling <zenghongling@kylinos.cn>
Subject: [PATCH] mm/pagewalk: use min() to simplify the code
Date: Tue, 20 Jan 2026 17:49:32 +0800 [thread overview]
Message-ID: <20260120094932.183697-1-zenghongling@kylinos.cn> (raw)
Use the min() macro to simplify the function and improve
its readability.
Signed-off-by: zenghongling <zenghongling@kylinos.cn>
---
mm/pagewalk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/pagewalk.c b/mm/pagewalk.c
index 9f91cf85a5be..82db421b5b34 100644
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@ -313,7 +313,7 @@ static unsigned long hugetlb_entry_end(struct hstate *h, unsigned long addr,
unsigned long end)
{
unsigned long boundary = (addr & huge_page_mask(h)) + huge_page_size(h);
- return boundary < end ? boundary : end;
+ return min(boundary, end);
}
static int walk_hugetlb_range(unsigned long addr, unsigned long end,
--
2.25.1
next reply other threads:[~2026-01-20 9:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 9:49 zenghongling [this message]
2026-01-20 10:41 ` Lorenzo Stoakes
2026-01-21 12:05 ` David Hildenbrand (Red Hat)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260120094932.183697-1-zenghongling@kylinos.cn \
--to=zenghongling@kylinos.cn \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=zhongling0719@126.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox