powerpc/mm: Fix build break with RADIX=y & HUGETLBFS=n
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 14 Feb 2017 02:11:38 +0000 (13:11 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 14 Feb 2017 05:54:21 +0000 (16:54 +1100)
If we enable RADIX but disable HUGETLBFS, the build breaks with:

  arch/powerpc/mm/pgtable-radix.c:557:7: error: implicit declaration of function 'pmd_huge'
  arch/powerpc/mm/pgtable-radix.c:588:7: error: implicit declaration of function 'pud_huge'

Fix it by stubbing those functions when HUGETLBFS=n.

Fixes: 4b5d62ca17a1 ("powerpc/mm: add radix__remove_section_mapping()")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/book3s/64/pgtable-4k.h
arch/powerpc/include/asm/book3s/64/pgtable-64k.h

index 9db83b4e017da3085b3daa88a30fcd4ca75f6905..8708a0239a56b9729a3229c59de7aa51a38abe65 100644 (file)
@@ -47,7 +47,12 @@ static inline int hugepd_ok(hugepd_t hpd)
        return hash__hugepd_ok(hpd);
 }
 #define is_hugepd(hpd)         (hugepd_ok(hpd))
+
+#else /* !CONFIG_HUGETLB_PAGE */
+static inline int pmd_huge(pmd_t pmd) { return 0; }
+static inline int pud_huge(pud_t pud) { return 0; }
 #endif /* CONFIG_HUGETLB_PAGE */
+
 #endif /* __ASSEMBLY__ */
 
 #endif /*_ASM_POWERPC_BOOK3S_64_PGTABLE_4K_H */
index 198aff33c38099f21108eafc8951dc51f1f2f578..2ce4209399edc46edc5779d0cf99570638146aa4 100644 (file)
@@ -46,6 +46,9 @@ static inline int hugepd_ok(hugepd_t hpd)
 }
 #define is_hugepd(pdep)                        0
 
+#else /* !CONFIG_HUGETLB_PAGE */
+static inline int pmd_huge(pmd_t pmd) { return 0; }
+static inline int pud_huge(pud_t pud) { return 0; }
 #endif /* CONFIG_HUGETLB_PAGE */
 
 static inline int remap_4k_pfn(struct vm_area_struct *vma, unsigned long addr,