path: root/arch/powerpc/include/asm/pgalloc-64.h
diff options
authorAneesh Kumar K.V <>2015-12-01 09:06:35 +0530
committerMichael Ellerman <>2015-12-14 15:19:07 +1100
commitf281b5d50c87ecca108dcbf8f791bd8923fde3de (patch)
treea29301f879dbacfe55ca64933e2bec276cf1c9fb /arch/powerpc/include/asm/pgalloc-64.h
parent10bd3808dfd067d6d6c941cc6e1b13be165f6a70 (diff)
powerpc/mm: Don't use pmd_val, pud_val and pgd_val as lvalue
We convert them static inline function here as we did with pte_val in the previous patch Acked-by: Scott Wood <> Signed-off-by: Aneesh Kumar K.V <> Signed-off-by: Michael Ellerman <>
Diffstat (limited to 'arch/powerpc/include/asm/pgalloc-64.h')
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h
index 4b0be20fcbfd..d8cde71f6734 100644
--- a/arch/powerpc/include/asm/pgalloc-64.h
+++ b/arch/powerpc/include/asm/pgalloc-64.h
@@ -53,7 +53,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
-#define pgd_populate(MM, PGD, PUD) pgd_set(PGD, PUD)
+#define pgd_populate(MM, PGD, PUD) pgd_set(PGD, (unsigned long)PUD)
static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
@@ -71,9 +71,18 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
pud_set(pud, (unsigned long)pmd);
-#define pmd_populate(mm, pmd, pte_page) \
- pmd_populate_kernel(mm, pmd, page_address(pte_page))
-#define pmd_populate_kernel(mm, pmd, pte) pmd_set(pmd, (unsigned long)(pte))
+static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
+ pte_t *pte)
+ pmd_set(pmd, (unsigned long)pte);
+static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
+ pgtable_t pte_page)
+ pmd_set(pmd, (unsigned long)page_address(pte_page));
#define pmd_pgtable(pmd) pmd_page(pmd)
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,