linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: zenghongling <zenghongling@kylinos.cn>
Cc: akpm@linux-foundation.org, david@kernel.org,
	Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org,
	surenb@google.com, mhocko@suse.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, zhongling0719@126.com
Subject: Re: [PATCH] mm/pagewalk: use min() to simplify the code
Date: Tue, 20 Jan 2026 10:41:56 +0000	[thread overview]
Message-ID: <bc9a831a-f677-46c9-a876-6e313f2094a3@lucifer.local> (raw)
In-Reply-To: <20260120094932.183697-1-zenghongling@kylinos.cn>

On Tue, Jan 20, 2026 at 05:49:32PM +0800, zenghongling wrote:
> Use the min() macro to simplify the function and improve
> its readability.
>
> Signed-off-by: zenghongling <zenghongling@kylinos.cn>

LGTM, other than nit below (Andrew, maybe you can insert a newline there?) so:

Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>

> ---
>  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);

Nit: Ideally we'd introduce a space between decl and statement below.

> -	return boundary < end ? boundary : end;
> +	return min(boundary, end);
>  }
>
>  static int walk_hugetlb_range(unsigned long addr, unsigned long end,
> --
> 2.25.1
>


  reply	other threads:[~2026-01-20 10:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20  9:49 zenghongling
2026-01-20 10:41 ` Lorenzo Stoakes [this message]
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=bc9a831a-f677-46c9-a876-6e313f2094a3@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --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=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=zenghongling@kylinos.cn \
    --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