[PATCH] x86-64: Remove mk_pte_phys()
authorAndi Kleen <ak@suse.de>
Tue, 13 Feb 2007 12:26:26 +0000 (13:26 +0100)
committerAndi Kleen <andi@basil.nowhere.org>
Tue, 13 Feb 2007 12:26:26 +0000 (13:26 +0100)
- Convert last user to pfn_pte
- Remove mk_pte_phys

Suggested by Jan Beulich

Signed-off-by: Andi Kleen <ak@suse.de>
arch/x86_64/mm/pageattr.c
include/asm-x86_64/pgtable.h

index ccb91dd996a957c1dc26f183e095c3a8edbd30f1..65c5eaa5990563048b1ac59e04e3dcd645441b5c 100644 (file)
@@ -107,6 +107,7 @@ static void revert_page(unsigned long address, pgprot_t ref_prot)
        pud_t *pud;
        pmd_t *pmd;
        pte_t large_pte;
+       unsigned long pfn;
 
        pgd = pgd_offset_k(address);
        BUG_ON(pgd_none(*pgd));
@@ -114,7 +115,8 @@ static void revert_page(unsigned long address, pgprot_t ref_prot)
        BUG_ON(pud_none(*pud));
        pmd = pmd_offset(pud, address);
        BUG_ON(pmd_val(*pmd) & _PAGE_PSE);
-       large_pte = mk_pte_phys(__pa(address) & LARGE_PAGE_MASK, ref_prot);
+       pfn = (__pa(address) & LARGE_PAGE_MASK) >> PAGE_SHIFT;
+       large_pte = pfn_pte(pfn, ref_prot);
        large_pte = pte_mkhuge(large_pte);
        set_pte((pte_t *)pmd, large_pte);
 }      
index 59901c690a0d4882744c770c4aabfa39ad605bb7..730bd6028416c5a9c28aa2767b19fdf85b816e78 100644 (file)
@@ -359,15 +359,6 @@ static inline int pmd_large(pmd_t pte) {
 #define mk_pte(page, pgprot)   pfn_pte(page_to_pfn(page), (pgprot))
 #define mk_pte_huge(entry) (pte_val(entry) |= _PAGE_PRESENT | _PAGE_PSE)
  
-/* physical address -> PTE */
-static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
-{ 
-       pte_t pte;
-       pte_val(pte) = physpage | pgprot_val(pgprot); 
-       pte_val(pte) &= __supported_pte_mask;
-       return pte; 
-}
 /* Change flags of a PTE */
 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 {