Skip to contentSkip to conversation

x86: cleanup dump_pagetable()

PATCH In review Akinobu Mita 1 participant 2 messages Jun 27, 2009 – Jun 29, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: cleanup dump_pagetable()

Use pgtable access helpers for 32bit version dump_pagetable() and get rid of __typeof__() operators. This needs to make pmd_pfn() available for 2-level pgtable.

Also, remove some casts for 64bit version dump_pagetable().

---
 arch/x86/include/asm/pgtable.h |   10 ++++----
 arch/x86/mm/fault.c            |   51 ++++++++++++++++-----------------------
 2 files changed, 26 insertions(+), 35 deletions(-)
arch/x86/include/asm/pgtable.h +5 -5
index 3cc06e3..af5481e 100644
@@ -134,6 +134,11 @@ static inline unsigned long pte_pfn(pte_t pte)
 	return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT;
 }
 
+static inline unsigned long pmd_pfn(pmd_t pmd)
+{
+	return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT;
+}
+
 #define pte_page(pte)	pfn_to_page(pte_pfn(pte))
 
 static inline int pmd_large(pmd_t pte)
@@ -422,11 +427,6 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
 	return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
 }
 
-static inline unsigned long pmd_pfn(pmd_t pmd)
-{
-	return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT;
-}
-
 static inline int pud_large(pud_t pud)
 {
 	return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) ==
arch/x86/mm/fault.c +21 -30

79 lines not on this page · raw message

#1 lore raw

[tip:x86/mm] x86: Clean up dump_pagetable()

Commit-ID:  087975b06b00af9bf888fab6f94ae113c5cd80bd
Gitweb:     http://git.kernel.org/tip/087975b06b00af9bf888fab6f94ae113c5cd80bd
Author:     Akinobu Mita <[email protected]>
AuthorDate: Sat, 27 Jun 2009 15:35:15 +0900
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 29 Jun 2009 06:14:42 +0200

x86: Clean up dump_pagetable()

Use pgtable access helpers for 32-bit version dump_pagetable() and get rid of __typeof__() operators. This needs to make pmd_pfn() available for 2-level pgtable.

Also, remove some casts for 64-bit version dump_pagetable().

LKML-Reference: <[email protected]>

---
 arch/x86/include/asm/pgtable.h |   10 ++++----
 arch/x86/mm/fault.c            |   51 ++++++++++++++++-----------------------
 2 files changed, 26 insertions(+), 35 deletions(-)
arch/x86/include/asm/pgtable.h +5 -5
index 3cc06e3..af5481e 100644
@@ -134,6 +134,11 @@ static inline unsigned long pte_pfn(pte_t pte)
 	return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT;
 }
 
+static inline unsigned long pmd_pfn(pmd_t pmd)
+{
+	return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT;
+}
+
 #define pte_page(pte)	pfn_to_page(pte_pfn(pte))
 
 static inline int pmd_large(pmd_t pte)
@@ -422,11 +427,6 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
 	return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
 }
 
-static inline unsigned long pmd_pfn(pmd_t pmd)
-{
-	return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT;
-}
-
 static inline int pud_large(pud_t pud)
 {
 	return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) ==
arch/x86/mm/fault.c +21 -30

79 lines not on this page · raw message