public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <ljs@kernel.org>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	 "Liam R. Howlett" <liam@infradead.org>,
	Vlastimil Babka <vbabka@kernel.org>,
	 Jann Horn <jannh@google.com>, Pedro Falcato <pfalcato@suse.de>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/mseal: use min/max in mseal_apply
Date: Tue, 5 May 2026 11:31:26 +0100	[thread overview]
Message-ID: <afnG21LZfHtaCG-D@lucifer> (raw)
In-Reply-To: <20260503115915.18680-3-thorsten.blum@linux.dev>

On Sun, May 03, 2026 at 01:59:16PM +0200, Thorsten Blum wrote:
> Use the type-checked min()/max() macros instead of MIN()/MAX(), which
> are supposed to be used "for obvious constants only".
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Oops my bad :)

LGTM, so:

Reviewed-by: Lorenzo Stoakes <ljs@kernel.org>

> ---
>  mm/mseal.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/mm/mseal.c b/mm/mseal.c
> index e2093ae3d25c..9781647483d1 100644
> --- a/mm/mseal.c
> +++ b/mm/mseal.c
> @@ -8,6 +8,7 @@
>   */
>
>  #include <linux/mempolicy.h>
> +#include <linux/minmax.h>
>  #include <linux/mman.h>
>  #include <linux/mm.h>
>  #include <linux/mm_inline.h>
> @@ -65,8 +66,8 @@ static int mseal_apply(struct mm_struct *mm,
>  		prev = vma;
>
>  	for_each_vma_range(vmi, vma, end) {
> -		const unsigned long curr_start = MAX(vma->vm_start, start);
> -		const unsigned long curr_end = MIN(vma->vm_end, end);
> +		const unsigned long curr_start = max(vma->vm_start, start);
> +		const unsigned long curr_end = min(vma->vm_end, end);
>
>  		if (!vma_test(vma, VMA_SEALED_BIT)) {
>  			vma_flags_t vma_flags = vma->flags;

      parent reply	other threads:[~2026-05-05 10:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-03 11:59 [PATCH] mm/mseal: use min/max in mseal_apply Thorsten Blum
2026-05-03 20:58 ` Pedro Falcato
2026-05-04 12:36   ` David Laight
2026-05-05 10:31 ` Lorenzo Stoakes [this message]

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=afnG21LZfHtaCG-D@lucifer \
    --to=ljs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jannh@google.com \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pfalcato@suse.de \
    --cc=thorsten.blum@linux.dev \
    --cc=vbabka@kernel.org \
    /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