diff options
author | James Morse <james.morse@arm.com> | 2018-10-05 09:49:16 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2018-10-05 12:19:40 -0400 |
commit | e9ed821be48600ea3ec7f7b76e478c769729f83c (patch) | |
tree | 43c4696f00d28695fe57c24d0c0adaf613ed463e | |
parent | 0293c8ba807c8611ea5503f9511029dd9082025a (diff) |
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: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r-- | arch/arm64/include/asm/pgtable.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index b58f764babf8..50b1ef8584c0 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
@@ -445,10 +445,12 @@ static inline bool in_swapper_pgdir(void *addr) | |||
445 | 445 | ||
446 | static inline void set_pmd(pmd_t *pmdp, pmd_t pmd) | 446 | static inline void set_pmd(pmd_t *pmdp, pmd_t pmd) |
447 | { | 447 | { |
448 | if (__is_defined(__PAGETABLE_PMD_FOLDED) && in_swapper_pgdir(pmdp)) { | 448 | #ifdef __PAGETABLE_PMD_FOLDED |
449 | if (in_swapper_pgdir(pmdp)) { | ||
449 | set_swapper_pgd((pgd_t *)pmdp, __pgd(pmd_val(pmd))); | 450 | set_swapper_pgd((pgd_t *)pmdp, __pgd(pmd_val(pmd))); |
450 | return; | 451 | return; |
451 | } | 452 | } |
453 | #endif /* __PAGETABLE_PMD_FOLDED */ | ||
452 | 454 | ||
453 | WRITE_ONCE(*pmdp, pmd); | 455 | WRITE_ONCE(*pmdp, pmd); |
454 | 456 | ||
@@ -503,10 +505,12 @@ static inline phys_addr_t pmd_page_paddr(pmd_t pmd) | |||
503 | 505 | ||
504 | static inline void set_pud(pud_t *pudp, pud_t pud) | 506 | static inline void set_pud(pud_t *pudp, pud_t pud) |
505 | { | 507 | { |
506 | if (__is_defined(__PAGETABLE_PUD_FOLDED) && in_swapper_pgdir(pudp)) { | 508 | #ifdef __PAGETABLE_PUD_FOLDED |
509 | if (in_swapper_pgdir(pudp)) { | ||
507 | set_swapper_pgd((pgd_t *)pudp, __pgd(pud_val(pud))); | 510 | set_swapper_pgd((pgd_t *)pudp, __pgd(pud_val(pud))); |
508 | return; | 511 | return; |
509 | } | 512 | } |
513 | #endif /* __PAGETABLE_PUD_FOLDED */ | ||
510 | 514 | ||
511 | WRITE_ONCE(*pudp, pud); | 515 | WRITE_ONCE(*pudp, pud); |
512 | 516 | ||