summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2014-06-04 19:08:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 19:54:05 -0400
commit2373eaecff33db5972bde9418f92d6401b4a945c (patch)
tree0f7f70bf508dcb3c91fe723661ca30fef32484e7 /arch
parentfa5bb2093a1d2ba552309a81139e0abebf5325d8 (diff)
mm: x86 pgtable: drop unneeded preprocessor ifdef
_PAGE_BIT_FILE (bit 6) is always less than _PAGE_BIT_PROTNONE (bit 8), so drop redundant #ifdef. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Peter Anvin <hpa@zytor.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Steven Noonan <steven@uplinklabs.net> Cc: Rik van Riel <riel@redhat.com> Cc: David Vrabel <david.vrabel@citrix.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/pgtable-2level.h10
-rw-r--r--arch/x86/include/asm/pgtable_64.h8
2 files changed, 0 insertions, 18 deletions
diff --git a/arch/x86/include/asm/pgtable-2level.h b/arch/x86/include/asm/pgtable-2level.h
index 0d193e234647..eec82d4c4473 100644
--- a/arch/x86/include/asm/pgtable-2level.h
+++ b/arch/x86/include/asm/pgtable-2level.h
@@ -115,13 +115,8 @@ static __always_inline pte_t pgoff_to_pte(pgoff_t off)
115 */ 115 */
116#define PTE_FILE_MAX_BITS 29 116#define PTE_FILE_MAX_BITS 29
117#define PTE_FILE_SHIFT1 (_PAGE_BIT_PRESENT + 1) 117#define PTE_FILE_SHIFT1 (_PAGE_BIT_PRESENT + 1)
118#if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE
119#define PTE_FILE_SHIFT2 (_PAGE_BIT_FILE + 1) 118#define PTE_FILE_SHIFT2 (_PAGE_BIT_FILE + 1)
120#define PTE_FILE_SHIFT3 (_PAGE_BIT_PROTNONE + 1) 119#define PTE_FILE_SHIFT3 (_PAGE_BIT_PROTNONE + 1)
121#else
122#define PTE_FILE_SHIFT2 (_PAGE_BIT_PROTNONE + 1)
123#define PTE_FILE_SHIFT3 (_PAGE_BIT_FILE + 1)
124#endif
125#define PTE_FILE_BITS1 (PTE_FILE_SHIFT2 - PTE_FILE_SHIFT1 - 1) 120#define PTE_FILE_BITS1 (PTE_FILE_SHIFT2 - PTE_FILE_SHIFT1 - 1)
126#define PTE_FILE_BITS2 (PTE_FILE_SHIFT3 - PTE_FILE_SHIFT2 - 1) 121#define PTE_FILE_BITS2 (PTE_FILE_SHIFT3 - PTE_FILE_SHIFT2 - 1)
127 122
@@ -153,13 +148,8 @@ static __always_inline pte_t pgoff_to_pte(pgoff_t off)
153#endif /* CONFIG_MEM_SOFT_DIRTY */ 148#endif /* CONFIG_MEM_SOFT_DIRTY */
154 149
155/* Encode and de-code a swap entry */ 150/* Encode and de-code a swap entry */
156#if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE
157#define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1) 151#define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1)
158#define SWP_OFFSET_SHIFT (_PAGE_BIT_PROTNONE + 1) 152#define SWP_OFFSET_SHIFT (_PAGE_BIT_PROTNONE + 1)
159#else
160#define SWP_TYPE_BITS (_PAGE_BIT_PROTNONE - _PAGE_BIT_PRESENT - 1)
161#define SWP_OFFSET_SHIFT (_PAGE_BIT_FILE + 1)
162#endif
163 153
164#define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS) 154#define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS)
165 155
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 6d6ecd09883c..5be9063545d2 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -143,7 +143,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; }
143#define pte_unmap(pte) ((void)(pte))/* NOP */ 143#define pte_unmap(pte) ((void)(pte))/* NOP */
144 144
145/* Encode and de-code a swap entry */ 145/* Encode and de-code a swap entry */
146#if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE
147#define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1) 146#define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1)
148#ifdef CONFIG_NUMA_BALANCING 147#ifdef CONFIG_NUMA_BALANCING
149/* Automatic NUMA balancing needs to be distinguishable from swap entries */ 148/* Automatic NUMA balancing needs to be distinguishable from swap entries */
@@ -151,13 +150,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; }
151#else 150#else
152#define SWP_OFFSET_SHIFT (_PAGE_BIT_PROTNONE + 1) 151#define SWP_OFFSET_SHIFT (_PAGE_BIT_PROTNONE + 1)
153#endif 152#endif
154#else
155#ifdef CONFIG_NUMA_BALANCING
156#error Incompatible format for automatic NUMA balancing
157#endif
158#define SWP_TYPE_BITS (_PAGE_BIT_PROTNONE - _PAGE_BIT_PRESENT - 1)
159#define SWP_OFFSET_SHIFT (_PAGE_BIT_FILE + 1)
160#endif
161 153
162#define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS) 154#define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS)
163 155