From e93e59ac1e699d07a2bfd0bb03f36b0d2f931834 Mon Sep 17 00:00:00 2001 From: Vineet Gupta Date: Wed, 30 Oct 2019 16:54:32 -0700 Subject: ARC: mm: pmd_populate* to use the canonical set_pmd (and drop pmd_set) Signed-off-by: Vineet Gupta --- arch/arc/include/asm/pgalloc.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'arch/arc/include/asm/pgalloc.h') diff --git a/arch/arc/include/asm/pgalloc.h b/arch/arc/include/asm/pgalloc.h index a32ca3104ced..408bc4b0842d 100644 --- a/arch/arc/include/asm/pgalloc.h +++ b/arch/arc/include/asm/pgalloc.h @@ -35,13 +35,19 @@ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) { - pmd_set(pmd, pte); + /* + * The cast to long below is OK in 32-bit PAE40 regime with long long pte + * Despite "wider" pte, the pte table needs to be in non-PAE low memory + * as all higher levels can only hold long pointers. + * + * The cast itself is needed given simplistic definition of set_pmd() + */ + set_pmd(pmd, __pmd((unsigned long)pte)); } -static inline void -pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t ptep) +static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t pte) { - pmd_set(pmd, (pte_t *) ptep); + set_pmd(pmd, __pmd((unsigned long)pte)); } static inline int __get_order_pgd(void) -- cgit v1.2.3