diff mbox series

[-next,3/3] mm/debug_vm_pgtable: Remove useless pfn_pmd()

Message ID 20210401022315.2911967-3-liushixin2@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next,1/3] mm/debug_vm_pgtable: Fix one comment mistake | expand

Commit Message

Liu Shixin April 1, 2021, 2:23 a.m. UTC
The call to pfn_pmd() here is redundant.

Signed-off-by: Shixin Liu <liushixin2@huawei.com>
---
 mm/debug_vm_pgtable.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Anshuman Khandual April 1, 2021, 2:41 p.m. UTC | #1
On 4/1/21 7:53 AM, Shixin Liu wrote:
> The call to pfn_pmd() here is redundant.
> 
> Signed-off-by: Shixin Liu <liushixin2@huawei.com>
> ---
>  mm/debug_vm_pgtable.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
> index c379bbe42c2a..9f4c4a114229 100644
> --- a/mm/debug_vm_pgtable.c
> +++ b/mm/debug_vm_pgtable.c
> @@ -196,7 +196,6 @@ static void __init pmd_advanced_tests(struct mm_struct *mm,
>  
>  	pgtable_trans_huge_deposit(mm, pmdp, pgtable);
>  
> -	pmd = pfn_pmd(pfn, prot);
>  	set_pmd_at(mm, vaddr, pmdp, pmd);
>  	pmdp_set_wrprotect(mm, vaddr, pmdp);
>  	pmd = READ_ONCE(*pmdp);
> 

Instead drop the first pfn_pmd(), as that pmd would not be required
when THP is not enabled. Also, please fold this with the first patch.
diff mbox series

Patch

diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
index c379bbe42c2a..9f4c4a114229 100644
--- a/mm/debug_vm_pgtable.c
+++ b/mm/debug_vm_pgtable.c
@@ -196,7 +196,6 @@  static void __init pmd_advanced_tests(struct mm_struct *mm,
 
 	pgtable_trans_huge_deposit(mm, pmdp, pgtable);
 
-	pmd = pfn_pmd(pfn, prot);
 	set_pmd_at(mm, vaddr, pmdp, pmd);
 	pmdp_set_wrprotect(mm, vaddr, pmdp);
 	pmd = READ_ONCE(*pmdp);