Re: [PATCH v2 09/13] mm: update all remaining mmap_prepare users to use vma_flags_t

Andrew Morton
2026-02-06T19:31:57Z

On Fri, 6 Feb 2026 17:46:36 +0000 Pedro Falcato <pfalcato@suse.de> wrote:

> > -#define VM_REMAP_FLAGS (VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
> > +#define VMA_REMAP_FLAGS mk_vma_flags(VMA_IO_BIT, VMA_PFNMAP_BIT, \
> > + VMA_DONTEXPAND_BIT, VMA_DONTDUMP_BIT)
>
> as a sidenote, these flags are no longer constant expressions and thus
>
> static vma_flags_t flags = VMA_REMAP_FLAGS;
>
> can't compile.

Yup, that isn't nice. An all-caps thing with no () is a compile-time
constant.

It looks like we can make this a nice inlined (commented!) lower-cased
C function as a little low-priority cleanup.

> Rest LGTM though.
>
> Acked-by: Pedro Falcato <pfalcato@suse.de>

Great, thanks.