mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 17:57:38 -04:00
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>
This commit is contained in:
committed by
Andrew Morton
parent
13f263b60f
commit
7d40e6b66d
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user