diff mbox series

[v2,3/5] x86: pgtable: Drop pXd_none() checks from pXd_free_pYd_table()

Message ID 1538478363-16255-4-git-send-email-will.deacon@arm.com
State Superseded
Headers show
Series Clean up huge vmap and ioremap code | expand

Commit Message

Will Deacon Oct. 2, 2018, 11:06 a.m. UTC
Now that the core code checks this for us, we don't need to do it in the
backend.

Cc: Chintan Pandya <cpandya@codeaurora.org>
Cc: Toshi Kani <toshi.kani@hpe.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hpe.com>

Signed-off-by: Will Deacon <will.deacon@arm.com>

---
 arch/x86/mm/pgtable.c | 6 ------
 1 file changed, 6 deletions(-)

-- 
2.1.4

Comments

Thomas Gleixner Oct. 2, 2018, 11:30 a.m. UTC | #1
On Tue, 2 Oct 2018, Will Deacon wrote:

Subject prefix wants to be 'x86/pgtable:' please

> Now that the core code checks this for us, we don't need to do it in the

> backend.


According to Documentation changelogs want to be written in imperative
mood.

  The core code has a check for pXd_none() already. Remove it in the
  architecture implementation.

Or something like that.

> Cc: Chintan Pandya <cpandya@codeaurora.org>

> Cc: Toshi Kani <toshi.kani@hpe.com>

> Cc: Thomas Gleixner <tglx@linutronix.de>

> Cc: Michal Hocko <mhocko@suse.com>

> Cc: Andrew Morton <akpm@linux-foundation.org>

> Reviewed-by: Toshi Kani <toshi.kani@hpe.com>

> Signed-off-by: Will Deacon <will.deacon@arm.com>


Other than the nits above:

  Acked-by: Thomas Gleixner <tglx@linutronix.de>
diff mbox series

Patch

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index ae394552fb94..b4919c44a194 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -796,9 +796,6 @@  int pud_free_pmd_page(pud_t *pud, unsigned long addr)
 	pte_t *pte;
 	int i;
 
-	if (pud_none(*pud))
-		return 1;
-
 	pmd = (pmd_t *)pud_page_vaddr(*pud);
 	pmd_sv = (pmd_t *)__get_free_page(GFP_KERNEL);
 	if (!pmd_sv)
@@ -840,9 +837,6 @@  int pmd_free_pte_page(pmd_t *pmd, unsigned long addr)
 {
 	pte_t *pte;
 
-	if (pmd_none(*pmd))
-		return 1;
-
 	pte = (pte_t *)pmd_page_vaddr(*pmd);
 	pmd_clear(pmd);