]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm/debug_vm_pgtable: remove redundant pfn_{pmd/pte}() and fix one comment mistake
authorShixin Liu <liushixin2@huawei.com>
Thu, 1 Jul 2021 01:47:40 +0000 (18:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 1 Jul 2021 03:47:26 +0000 (20:47 -0700)
Remove redundant pfn_{pmd/pte}() in {pmd/pte}_advanced_tests() and adjust
pfn_pud() in pud_advanced_tests() to make it similar with other two
functions.

In addition, the branch condition should be CONFIG_TRANSPARENT_HUGEPAGE
instead of CONFIG_ARCH_HAS_PTE_DEVMAP.

Link: https://lkml.kernel.org/r/20210419071820.750217-2-liushixin2@huawei.com
Signed-off-by: Shixin Liu <liushixin2@huawei.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/debug_vm_pgtable.c

index 760bb319f731f7f74582df5ac73a0780e396afbe..f7b23565a04f0991e00769dfc89d9502e142eff7 100644 (file)
@@ -91,7 +91,7 @@ static void __init pte_advanced_tests(struct mm_struct *mm,
                                      unsigned long pfn, unsigned long vaddr,
                                      pgprot_t prot)
 {
-       pte_t pte = pfn_pte(pfn, prot);
+       pte_t pte;
 
        /*
         * Architectures optimize set_pte_at by avoiding TLB flush.
@@ -778,12 +778,12 @@ static void __init pmd_swap_soft_dirty_tests(unsigned long pfn, pgprot_t prot)
        WARN_ON(!pmd_swp_soft_dirty(pmd_swp_mksoft_dirty(pmd)));
        WARN_ON(pmd_swp_soft_dirty(pmd_swp_clear_soft_dirty(pmd)));
 }
-#else  /* !CONFIG_ARCH_HAS_PTE_DEVMAP */
+#else  /* !CONFIG_TRANSPARENT_HUGEPAGE */
 static void __init pmd_soft_dirty_tests(unsigned long pfn, pgprot_t prot) { }
 static void __init pmd_swap_soft_dirty_tests(unsigned long pfn, pgprot_t prot)
 {
 }
-#endif /* CONFIG_ARCH_HAS_PTE_DEVMAP */
+#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
 static void __init pte_swap_tests(unsigned long pfn, pgprot_t prot)
 {