Skip to content

Commit fdf743c

Browse files
dgibsonmpe
authored andcommitted
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. 6fa5048 "powerpc/mm/hugetlb: initialize the pagetable cache correctly for hugetlb" removed that double meaning, but left the now useless constants. Signed-off-by: David Gibson <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent a8bf9e5 commit fdf743c

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

arch/powerpc/mm/hugetlbpage.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,6 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp,
117117
return 0;
118118
}
119119

120-
/*
121-
* These macros define how to determine which level of the page table holds
122-
* the hpdp.
123-
*/
124-
#if defined(CONFIG_PPC_FSL_BOOK3E) || defined(CONFIG_PPC_8xx)
125-
#define HUGEPD_PGD_SHIFT PGDIR_SHIFT
126-
#define HUGEPD_PUD_SHIFT PUD_SHIFT
127-
#endif
128-
129120
/*
130121
* At this point we do the placement change only for BOOK3S 64. This would
131122
* possibly work on other subarchs.
@@ -174,13 +165,13 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz
174165
}
175166
}
176167
#else
177-
if (pshift >= HUGEPD_PGD_SHIFT) {
168+
if (pshift >= PGDIR_SHIFT) {
178169
ptl = &mm->page_table_lock;
179170
hpdp = (hugepd_t *)pg;
180171
} else {
181172
pdshift = PUD_SHIFT;
182173
pu = pud_alloc(mm, pg, addr);
183-
if (pshift >= HUGEPD_PUD_SHIFT) {
174+
if (pshift >= PUD_SHIFT) {
184175
ptl = pud_lockptr(mm, pu);
185176
hpdp = (hugepd_t *)pu;
186177
} else {
@@ -692,9 +683,9 @@ static int __init hugetlbpage_init(void)
692683
else
693684
pdshift = PMD_SHIFT;
694685
#else
695-
if (shift < HUGEPD_PUD_SHIFT)
686+
if (shift < PUD_SHIFT)
696687
pdshift = PMD_SHIFT;
697-
else if (shift < HUGEPD_PGD_SHIFT)
688+
else if (shift < PGDIR_SHIFT)
698689
pdshift = PUD_SHIFT;
699690
else
700691
pdshift = PGDIR_SHIFT;

0 commit comments

Comments
 (0)