Re: [PATCH 1/3] mm: change vm_get_page_prot() to accept vm_flags_t argument

Lorenzo Stoakes
2025-06-19T12:27:45Z

Hi Andrew,

I enclose a quick fix-patch to address a case I missed and to avoid any risk of
circular dependency in a header include.

Thanks to Vlastimil and Oscar for spotting this! :)

Cheers, Lorenzo

----8<----
From d66fe0b934098ccc2ba45f739277fffe86c91442 Mon Sep 17 00:00:00 2001
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Date: Thu, 19 Jun 2025 13:21:15 +0100
Subject: [PATCH] mm: add missing vm_get_page_prot() instance, remove include

I missed a case for powerpc, also remove #include (that is not in practice
necessary) to avoid any risk of circular dependency.

Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
---
arch/powerpc/include/asm/book3s/64/pkeys.h | 1 -
arch/powerpc/mm/book3s64/pgtable.c | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/64/pkeys.h b/arch/powerpc/include/asm/book3s/64/pkeys.h
index 6f2075636591..ff911b4251d9 100644
--- a/arch/powerpc/include/asm/book3s/64/pkeys.h
+++ b/arch/powerpc/include/asm/book3s/64/pkeys.h
@@ -4,7 +4,6 @@
#define _ASM_POWERPC_BOOK3S_64_PKEYS_H

#include <asm/book3s/64/hash-pkey.h>
-#include <linux/mm_types.h>

static inline u64 vmflag_to_pte_pkey_bits(vm_flags_t vm_flags)
{
diff --git a/arch/powerpc/mm/book3s64/pgtable.c b/arch/powerpc/mm/book3s64/pgtable.c
index b38cd0b6af13..c9431ae7f78a 100644
--- a/arch/powerpc/mm/book3s64/pgtable.c
+++ b/arch/powerpc/mm/book3s64/pgtable.c
@@ -642,7 +642,7 @@ unsigned long memremap_compat_align(void)
EXPORT_SYMBOL_GPL(memremap_compat_align);
#endif

-pgprot_t vm_get_page_prot(unsigned long vm_flags)
+pgprot_t vm_get_page_prot(vm_flags_t vm_flags)
{
unsigned long prot;

--
2.49.0