Commit e9ed821b authored by James Morse's avatar James Morse Committed by Catalin Marinas

arm64: mm: Use #ifdef for the __PAGETABLE_P?D_FOLDED defines

__is_defined(__PAGETABLE_P?D_FOLDED) doesn't quite work as intended
as these symbols are internal to asm-generic and aren't defined in the
way kconfig expects. This makes them always evaluate to false.
Switch to #ifdef.
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarJames Morse <james.morse@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 0293c8ba
...@@ -445,10 +445,12 @@ static inline bool in_swapper_pgdir(void *addr) ...@@ -445,10 +445,12 @@ static inline bool in_swapper_pgdir(void *addr)
static inline void set_pmd(pmd_t *pmdp, pmd_t pmd) static inline void set_pmd(pmd_t *pmdp, pmd_t pmd)
{ {
if (__is_defined(__PAGETABLE_PMD_FOLDED) && in_swapper_pgdir(pmdp)) { #ifdef __PAGETABLE_PMD_FOLDED
if (in_swapper_pgdir(pmdp)) {
set_swapper_pgd((pgd_t *)pmdp, __pgd(pmd_val(pmd))); set_swapper_pgd((pgd_t *)pmdp, __pgd(pmd_val(pmd)));
return; return;
} }
#endif /* __PAGETABLE_PMD_FOLDED */
WRITE_ONCE(*pmdp, pmd); WRITE_ONCE(*pmdp, pmd);
...@@ -503,10 +505,12 @@ static inline phys_addr_t pmd_page_paddr(pmd_t pmd) ...@@ -503,10 +505,12 @@ static inline phys_addr_t pmd_page_paddr(pmd_t pmd)
static inline void set_pud(pud_t *pudp, pud_t pud) static inline void set_pud(pud_t *pudp, pud_t pud)
{ {
if (__is_defined(__PAGETABLE_PUD_FOLDED) && in_swapper_pgdir(pudp)) { #ifdef __PAGETABLE_PUD_FOLDED
if (in_swapper_pgdir(pudp)) {
set_swapper_pgd((pgd_t *)pudp, __pgd(pud_val(pud))); set_swapper_pgd((pgd_t *)pudp, __pgd(pud_val(pud)));
return; return;
} }
#endif /* __PAGETABLE_PUD_FOLDED */
WRITE_ONCE(*pudp, pud); WRITE_ONCE(*pudp, pud);
......
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