Re: [PATCH v3 2/2] mm: redefine VM_* flag constants with BIT()
From: David Hildenbrand
Date: Wed Oct 01 2025 - 10:06:47 EST
-#define VM_GROWSDOWN 0x00000100 /* general info on the segment */
+#define VM_GROWSDOWN BIT(8) /* general info on the segment */
#ifdef CONFIG_MMU
-#define VM_UFFD_MISSING 0x00000200 /* missing pages tracking */
+#define VM_UFFD_MISSING BIT(9) /* missing pages tracking */
#else /* CONFIG_MMU */
-#define VM_MAYOVERLAY 0x00000200 /* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
+#define VM_MAYOVERLAY BIT(10) /* nommu: R/O MAP_PRIVATE mapping that might overlay a file mapping */
Careful: VM_UFFD_MISSING and VM_MAYOVERLAY share the same bit, depending
on CONFIG_MMU (9).
#define VM_UFFD_MISSING 0
#endif /* CONFIG_MMU */
-#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */
-#define VM_UFFD_WP 0x00001000 /* wrprotect pages tracking */
+#define VM_PFNMAP BIT(11) /* Page-ranges managed without "struct page", just pure PFN */
-> 10
11 is actually unused IIUC.
+#define VM_UFFD_WP BIT(12) /* wrprotect pages tracking */
This seems to be correct again.
IIRC, Andrew prefers not mixing fixes and cleanups in the same series if
possible. So you might just want to send out patch #1 separately and,
send out patch #2 separately with a note under the --- that it depends
on patch #1.
--
Cheers
David / dhildenb