Skip to content

Commit f949286

Browse files
rppttorvalds
authored andcommitted
mm: remove __ARCH_HAS_4LEVEL_HACK and include/asm-generic/4level-fixup.h
There are no architectures that use include/asm-generic/4level-fixup.h therefore it can be removed along with __ARCH_HAS_4LEVEL_HACK define. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Mike Rapoport <[email protected]> Cc: Anatoly Pugachev <[email protected]> Cc: Anton Ivanov <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Greentime Hu <[email protected]> Cc: Greg Ungerer <[email protected]> Cc: Helge Deller <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Jeff Dike <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: Mark Salter <[email protected]> Cc: Matt Turner <[email protected]> Cc: Michal Simek <[email protected]> Cc: Peter Rosin <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Rolf Eike Beer <[email protected]> Cc: Russell King <[email protected]> Cc: Russell King <[email protected]> Cc: Sam Creasey <[email protected]> Cc: Vincent Chen <[email protected]> Cc: Vineet Gupta <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e19f97e commit f949286

File tree

3 files changed

+5
-52
lines changed

3 files changed

+5
-52
lines changed

include/asm-generic/4level-fixup.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

include/linux/mm.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,12 +1838,12 @@ static inline void mm_dec_nr_ptes(struct mm_struct *mm) {}
18381838
int __pte_alloc(struct mm_struct *mm, pmd_t *pmd);
18391839
int __pte_alloc_kernel(pmd_t *pmd);
18401840

1841+
#if defined(CONFIG_MMU)
1842+
18411843
/*
1842-
* The following ifdef needed to get the 4level-fixup.h header to work.
1843-
* Remove it when 4level-fixup.h has been removed.
1844+
* The following ifdef needed to get the 5level-fixup.h header to work.
1845+
* Remove it when 5level-fixup.h has been removed.
18441846
*/
1845-
#if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK)
1846-
18471847
#ifndef __ARCH_HAS_5LEVEL_HACK
18481848
static inline p4d_t *p4d_alloc(struct mm_struct *mm, pgd_t *pgd,
18491849
unsigned long address)
@@ -1865,7 +1865,7 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a
18651865
return (unlikely(pud_none(*pud)) && __pmd_alloc(mm, pud, address))?
18661866
NULL: pmd_offset(pud, address);
18671867
}
1868-
#endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */
1868+
#endif /* CONFIG_MMU */
18691869

18701870
#if USE_SPLIT_PTE_PTLOCKS
18711871
#if ALLOC_SPLIT_PTLOCKS

mm/memory.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4197,19 +4197,11 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
41974197
smp_wmb(); /* See comment in __pte_alloc */
41984198

41994199
ptl = pud_lock(mm, pud);
4200-
#ifndef __ARCH_HAS_4LEVEL_HACK
42014200
if (!pud_present(*pud)) {
42024201
mm_inc_nr_pmds(mm);
42034202
pud_populate(mm, pud, new);
42044203
} else /* Another has populated it */
42054204
pmd_free(mm, new);
4206-
#else
4207-
if (!pgd_present(*pud)) {
4208-
mm_inc_nr_pmds(mm);
4209-
pgd_populate(mm, pud, new);
4210-
} else /* Another has populated it */
4211-
pmd_free(mm, new);
4212-
#endif /* __ARCH_HAS_4LEVEL_HACK */
42134205
spin_unlock(ptl);
42144206
return 0;
42154207
}

0 commit comments

Comments
 (0)