Commit 4df4b275 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/mm: cleanup remaining ifdef mess in hugetlbpage.c

Only 3 subarches support huge pages. So when it is either 2 of them,
it is not the third one.

And mmu_has_feature() is known by all subarches so IS_ENABLED() can
be used instead of #ifdef
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent c5710cd2
...@@ -226,7 +226,7 @@ int __init alloc_bootmem_huge_page(struct hstate *h) ...@@ -226,7 +226,7 @@ int __init alloc_bootmem_huge_page(struct hstate *h)
return __alloc_bootmem_huge_page(h); return __alloc_bootmem_huge_page(h);
} }
#if defined(CONFIG_PPC_FSL_BOOK3E) || defined(CONFIG_PPC_8xx) #ifndef CONFIG_PPC_BOOK3S_64
#define HUGEPD_FREELIST_SIZE \ #define HUGEPD_FREELIST_SIZE \
((PAGE_SIZE - sizeof(struct hugepd_freelist)) / sizeof(pte_t)) ((PAGE_SIZE - sizeof(struct hugepd_freelist)) / sizeof(pte_t))
...@@ -595,10 +595,10 @@ static int __init hugetlbpage_init(void) ...@@ -595,10 +595,10 @@ static int __init hugetlbpage_init(void)
return 0; return 0;
} }
#if !defined(CONFIG_PPC_FSL_BOOK3E) && !defined(CONFIG_PPC_8xx) if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) && !radix_enabled() &&
if (!radix_enabled() && !mmu_has_feature(MMU_FTR_16M_PAGE)) !mmu_has_feature(MMU_FTR_16M_PAGE))
return -ENODEV; return -ENODEV;
#endif
for (psize = 0; psize < MMU_PAGE_COUNT; ++psize) { for (psize = 0; psize < MMU_PAGE_COUNT; ++psize) {
unsigned shift; unsigned shift;
unsigned pdshift; unsigned pdshift;
...@@ -636,10 +636,8 @@ static int __init hugetlbpage_init(void) ...@@ -636,10 +636,8 @@ static int __init hugetlbpage_init(void)
pgtable_cache_add(PTE_INDEX_SIZE); pgtable_cache_add(PTE_INDEX_SIZE);
else if (pdshift > shift) else if (pdshift > shift)
pgtable_cache_add(pdshift - shift); pgtable_cache_add(pdshift - shift);
#if defined(CONFIG_PPC_FSL_BOOK3E) || defined(CONFIG_PPC_8xx) else if (IS_ENABLED(CONFIG_PPC_FSL_BOOK3E) || IS_ENABLED(CONFIG_PPC_8xx))
else
pgtable_cache_add(PTE_T_ORDER); pgtable_cache_add(PTE_T_ORDER);
#endif
} }
if (IS_ENABLED(HUGETLB_PAGE_SIZE_VARIABLE)) if (IS_ENABLED(HUGETLB_PAGE_SIZE_VARIABLE))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment