Having vma_get_page_prot() refer to VMA flags and vma_set_page_prot() refer to a VMA is confusing. Rename vma_get_page_prot() to vma_flags_to_page_prot() to resolve this confusion. No functional change intended. Signed-off-by: Lorenzo Stoakes --- include/linux/mm.h | 4 ++-- mm/vma.c | 2 +- mm/vma.h | 2 +- tools/testing/vma/include/dup.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 474b3698f565..c8336f68d7bb 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -4568,7 +4568,7 @@ static inline bool range_in_vma_desc(const struct vm_area_desc *desc, #ifdef CONFIG_MMU pgprot_t vm_get_page_prot(vm_flags_t vm_flags); -static inline pgprot_t vma_get_page_prot(vma_flags_t vma_flags) +static inline pgprot_t vma_flags_to_page_prot(vma_flags_t vma_flags) { const vm_flags_t vm_flags = vma_flags_to_legacy(vma_flags); @@ -4581,7 +4581,7 @@ static inline pgprot_t vm_get_page_prot(vm_flags_t vm_flags) { return __pgprot(0); } -static inline pgprot_t vma_get_page_prot(vma_flags_t vma_flags) +static inline pgprot_t vma_flags_to_page_prot(vma_flags_t vma_flags) { return __pgprot(0); } diff --git a/mm/vma.c b/mm/vma.c index 395b6619ecc1..fcdd2ac3ac68 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -56,7 +56,7 @@ struct mmap_state { .pglen = PHYS_PFN(len_), \ .vma_flags = vma_flags_, \ .file = file_, \ - .page_prot = vma_get_page_prot(vma_flags_), \ + .page_prot = vma_flags_to_page_prot(vma_flags_), \ } #define VMG_MMAP_STATE(name, map_, vma_) \ diff --git a/mm/vma.h b/mm/vma.h index 6a8abb8ae937..d6b48d596f44 100644 --- a/mm/vma.h +++ b/mm/vma.h @@ -524,7 +524,7 @@ static inline bool vma_wants_manual_pte_write_upgrade(struct vm_area_struct *vma #ifdef CONFIG_MMU static inline pgprot_t vma_pgprot_modify(pgprot_t oldprot, vma_flags_t vma_flags) { - const pgprot_t prot = vma_get_page_prot(vma_flags); + const pgprot_t prot = vma_flags_to_page_prot(vma_flags); return pgprot_modify(oldprot, prot); } diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/dup.h index 813044781719..1ffac38a5377 100644 --- a/tools/testing/vma/include/dup.h +++ b/tools/testing/vma/include/dup.h @@ -1555,7 +1555,7 @@ static inline int get_sysctl_max_map_count(void) #define pgtable_supports_soft_dirty() IS_ENABLED(CONFIG_MEM_SOFT_DIRTY) #endif -static inline pgprot_t vma_get_page_prot(vma_flags_t vma_flags) +static inline pgprot_t vma_flags_to_page_prot(vma_flags_t vma_flags) { const vm_flags_t vm_flags = vma_flags_to_legacy(vma_flags); -- 2.54.0