From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B052281357 for ; Tue, 5 May 2026 10:31:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777977090; cv=none; b=QycXqrP2r+GMp7sW9aurh1R6Z+7B7RjzwRuaxTKQq50iu0T0uLUHx+vTBrTQOT1+ISA+qOFD1QJb3Hez71s9nbUweisd6QrnscepjXCs1kCqRFllomfQV7AHfTUN1de4U4Uq0YGb9txmBGnXfrHd3kvinZPsFX9aITBdXisGNdU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777977090; c=relaxed/simple; bh=6mQeMAklyZvmMXcq40qNy3C5krqUWvUCfCqbcMJnxRw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XUweiOI0S9nA7OY7llPnUZpt17w8LKD6X1g06eoJJa7cn+OBJMHKW2RQfWezh39JtF6RWuYcwA2BQzYcMqtRM46N3WNTeymySL+MdaLVh2cpUtRcO3E8e/DEUiSl+7RcQfSIMthV/CsmMFuB+zQPlWBCQok9nM1266h+weEHAK8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tG1KSajG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tG1KSajG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11A04C2BCB4; Tue, 5 May 2026 10:31:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777977090; bh=6mQeMAklyZvmMXcq40qNy3C5krqUWvUCfCqbcMJnxRw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tG1KSajG01OkjGtG++XsDL+rekKw3rHS2oC9URVkbuiquwBc/8luxj0K4TXrRmaDW cNpIWi2rYfJrmdI5llAhI2u2Red5C7GiYwatKayO0wzQEGeJoyK4Q93yCtkiL8z3BM gHCggL+oEjzBerjndwBQArwm9GlV+efBSAmOFxn1Vg+y1ygLgjFHk8GmYvd9DG9xCG AqNqfZZTG5ArJZIsihLzrZZ+YSX+7UedBXmIVW/W9iVQfGMEsMyd8FcRZNM3mlUckD f3Q10L7/deBeJSNQVa9hYxrNJ+6T0TsIO0/ITLctEcMCOxnHDUxmFJAEJ6+A9L0JCd 61ugf2YY0YKQg== Date: Tue, 5 May 2026 11:31:26 +0100 From: Lorenzo Stoakes To: Thorsten Blum Cc: Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Jann Horn , Pedro Falcato , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/mseal: use min/max in mseal_apply Message-ID: References: <20260503115915.18680-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Oops my bad :) LGTM, so: Reviewed-by: Lorenzo Stoakes > --- > 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 > +#include > #include > #include > #include > @@ -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;