aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm
diff options
context:
space:
mode:
authorAnshuman Khandual <anshuman.khandual@arm.com>2019-05-20 23:35:03 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2019-06-03 11:58:37 -0400
commit441a627806873c1b63d06dea4391e79c88b8e496 (patch)
tree584332906a336ff1cde067aa7d7decab8693abd6 /arch/arm64/mm
parentf2c7c76c5d0a443053e94adb9f0918fa2fb85c3a (diff)
arm64/hugetlb: Use macros for contiguous huge page sizes
Replace all open encoded contiguous huge page size computations with available macro encodings CONT_PTE_SIZE and CONT_PMD_SIZE. There are other instances where these macros are used in the file and this change makes it consistently use the same mnemonic. Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Steve Capper <steve.capper@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r--arch/arm64/mm/hugetlbpage.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
index f475e54fbc43..bbeb6a5a6ba6 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -228,7 +228,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
228 228
229 if (sz == PUD_SIZE) { 229 if (sz == PUD_SIZE) {
230 ptep = (pte_t *)pudp; 230 ptep = (pte_t *)pudp;
231 } else if (sz == (PAGE_SIZE * CONT_PTES)) { 231 } else if (sz == (CONT_PTE_SIZE)) {
232 pmdp = pmd_alloc(mm, pudp, addr); 232 pmdp = pmd_alloc(mm, pudp, addr);
233 233
234 WARN_ON(addr & (sz - 1)); 234 WARN_ON(addr & (sz - 1));
@@ -246,7 +246,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
246 ptep = huge_pmd_share(mm, addr, pudp); 246 ptep = huge_pmd_share(mm, addr, pudp);
247 else 247 else
248 ptep = (pte_t *)pmd_alloc(mm, pudp, addr); 248 ptep = (pte_t *)pmd_alloc(mm, pudp, addr);
249 } else if (sz == (PMD_SIZE * CONT_PMDS)) { 249 } else if (sz == (CONT_PMD_SIZE)) {
250 pmdp = pmd_alloc(mm, pudp, addr); 250 pmdp = pmd_alloc(mm, pudp, addr);
251 WARN_ON(addr & (sz - 1)); 251 WARN_ON(addr & (sz - 1));
252 return (pte_t *)pmdp; 252 return (pte_t *)pmdp;
@@ -454,9 +454,9 @@ static int __init hugetlbpage_init(void)
454#ifdef CONFIG_ARM64_4K_PAGES 454#ifdef CONFIG_ARM64_4K_PAGES
455 add_huge_page_size(PUD_SIZE); 455 add_huge_page_size(PUD_SIZE);
456#endif 456#endif
457 add_huge_page_size(PMD_SIZE * CONT_PMDS); 457 add_huge_page_size(CONT_PMD_SIZE);
458 add_huge_page_size(PMD_SIZE); 458 add_huge_page_size(PMD_SIZE);
459 add_huge_page_size(PAGE_SIZE * CONT_PTES); 459 add_huge_page_size(CONT_PTE_SIZE);
460 460
461 return 0; 461 return 0;
462} 462}
@@ -470,9 +470,9 @@ static __init int setup_hugepagesz(char *opt)
470#ifdef CONFIG_ARM64_4K_PAGES 470#ifdef CONFIG_ARM64_4K_PAGES
471 case PUD_SIZE: 471 case PUD_SIZE:
472#endif 472#endif
473 case PMD_SIZE * CONT_PMDS: 473 case CONT_PMD_SIZE:
474 case PMD_SIZE: 474 case PMD_SIZE:
475 case PAGE_SIZE * CONT_PTES: 475 case CONT_PTE_SIZE:
476 add_huge_page_size(ps); 476 add_huge_page_size(ps);
477 return 1; 477 return 1;
478 } 478 }