mm: reorder includes after introduction of linux/pgtable.h
[sfrench/cifs-2.6.git] / arch / x86 / mm / ioremap.c
index 18c637c0dc6fa8c2f51393903f8d4e1546fb6d5d..84d85dbd1dad6f430c9bf174146dd377cffe59c6 100644 (file)
 #include <linux/mmiotrace.h>
 #include <linux/mem_encrypt.h>
 #include <linux/efi.h>
+#include <linux/pgtable.h>
 
 #include <asm/set_memory.h>
 #include <asm/e820/api.h>
 #include <asm/efi.h>
 #include <asm/fixmap.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/pgalloc.h>
 #include <asm/memtype.h>
@@ -778,10 +778,8 @@ void __init *early_memremap_encrypted(resource_size_t phys_addr,
 void __init *early_memremap_encrypted_wp(resource_size_t phys_addr,
                                         unsigned long size)
 {
-       /* Be sure the write-protect PAT entry is set for write-protect */
-       if (__pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] != _PAGE_CACHE_MODE_WP)
+       if (!x86_has_pat_wp())
                return NULL;
-
        return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_ENC_WP);
 }
 
@@ -799,10 +797,8 @@ void __init *early_memremap_decrypted(resource_size_t phys_addr,
 void __init *early_memremap_decrypted_wp(resource_size_t phys_addr,
                                         unsigned long size)
 {
-       /* Be sure the write-protect PAT entry is set for write-protect */
-       if (__pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] != _PAGE_CACHE_MODE_WP)
+       if (!x86_has_pat_wp())
                return NULL;
-
        return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_NOENC_WP);
 }
 #endif /* CONFIG_AMD_MEM_ENCRYPT */
@@ -889,5 +885,5 @@ void __init __early_set_fixmap(enum fixed_addresses idx,
                set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags));
        else
                pte_clear(&init_mm, addr, pte);
-       __flush_tlb_one_kernel(addr);
+       flush_tlb_one_kernel(addr);
 }