Commit fdf743c5 authored by David Gibson's avatar David Gibson Committed by Michael Ellerman

powerpc/hugetlbpage: Rmove unhelpful HUGEPD_*_SHIFT macros

The HUGEPD_*_SHIFT macros are always defined to be PGDIR_SHIFT and
PUD_SHIFT, and have to have those values to work properly.  They once used
to have different values, but that was really only because they were used
to mean different things in different contexts.

6fa50483 "powerpc/mm/hugetlb: initialize the pagetable cache correctly for
hugetlb" removed that double meaning, but left the now useless constants.
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent a8bf9e50
...@@ -117,15 +117,6 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp, ...@@ -117,15 +117,6 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp,
return 0; return 0;
} }
/*
* These macros define how to determine which level of the page table holds
* the hpdp.
*/
#if defined(CONFIG_PPC_FSL_BOOK3E) || defined(CONFIG_PPC_8xx)
#define HUGEPD_PGD_SHIFT PGDIR_SHIFT
#define HUGEPD_PUD_SHIFT PUD_SHIFT
#endif
/* /*
* At this point we do the placement change only for BOOK3S 64. This would * At this point we do the placement change only for BOOK3S 64. This would
* possibly work on other subarchs. * possibly work on other subarchs.
...@@ -174,13 +165,13 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz ...@@ -174,13 +165,13 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz
} }
} }
#else #else
if (pshift >= HUGEPD_PGD_SHIFT) { if (pshift >= PGDIR_SHIFT) {
ptl = &mm->page_table_lock; ptl = &mm->page_table_lock;
hpdp = (hugepd_t *)pg; hpdp = (hugepd_t *)pg;
} else { } else {
pdshift = PUD_SHIFT; pdshift = PUD_SHIFT;
pu = pud_alloc(mm, pg, addr); pu = pud_alloc(mm, pg, addr);
if (pshift >= HUGEPD_PUD_SHIFT) { if (pshift >= PUD_SHIFT) {
ptl = pud_lockptr(mm, pu); ptl = pud_lockptr(mm, pu);
hpdp = (hugepd_t *)pu; hpdp = (hugepd_t *)pu;
} else { } else {
...@@ -692,9 +683,9 @@ static int __init hugetlbpage_init(void) ...@@ -692,9 +683,9 @@ static int __init hugetlbpage_init(void)
else else
pdshift = PMD_SHIFT; pdshift = PMD_SHIFT;
#else #else
if (shift < HUGEPD_PUD_SHIFT) if (shift < PUD_SHIFT)
pdshift = PMD_SHIFT; pdshift = PMD_SHIFT;
else if (shift < HUGEPD_PGD_SHIFT) else if (shift < PGDIR_SHIFT)
pdshift = PUD_SHIFT; pdshift = PUD_SHIFT;
else else
pdshift = PGDIR_SHIFT; pdshift = PGDIR_SHIFT;
......
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