aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
authorThorsten Blum <thorsten.blum@linux.dev>2026-05-03 13:59:16 +0200
committerAndrew Morton <akpm@linux-foundation.org>2026-05-28 21:31:01 -0700
commitda7b82037a01d5670ad53ff95e6bd8288e9bfb3a (patch)
treedcb6e8f22e5ab3b0a723f3792f3d6782536849e7 /mm
parent81ff95710c2dce47da9da4112a78743b2b23e108 (diff)
downloadlinux-next-history-da7b82037a01d5670ad53ff95e6bd8288e9bfb3a.tar.gz
mm/mseal: use min/max in mseal_apply
Use the type-checked min()/max() macros instead of MIN()/MAX(), which are supposed to be used "for obvious constants only". Link: https://lore.kernel.org/20260503115915.18680-3-thorsten.blum@linux.dev Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Pedro Falcato <pfalcato@suse.de> Reviewed-by: Lorenzo Stoakes <ljs@kernel.org> Acked-by: David Hildenbrand (Arm) <david@kernel.org> Reviewed-by: SeongJae Park <sj@kernel.org> Cc: Jann Horn <jannh@google.com> Cc: Liam R. Howlett <liam@infradead.org> Cc: Thorsten Blum <thorsten.blum@linux.dev> Cc: Vlastimil Babka <vbabka@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/mseal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/mseal.c b/mm/mseal.c
index e2093ae3d25cd..9781647483d19 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;