From: Thorsten Blum Date: Sun, 3 May 2026 11:59:16 +0000 (+0200) Subject: mm/mseal: use min/max in mseal_apply X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d40e6b66d97d7feef8ca3c096827fd24c6d623d;p=thirdparty%2Flinux.git 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 Reviewed-by: Pedro Falcato Reviewed-by: Lorenzo Stoakes Acked-by: David Hildenbrand (Arm) Reviewed-by: SeongJae Park Cc: Jann Horn Cc: Liam R. Howlett Cc: Thorsten Blum Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- 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;