diff options
author | Liu Hua <sdu.liu@huawei.com> | 2014-04-18 04:27:01 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-04-23 06:09:27 -0400 |
commit | 4221e2e6b3160e4b558df14fa79f025c0e277935 (patch) | |
tree | 35a6bed487f7ab9ddaa557eb9f447bbaec8824ca /arch/arm | |
parent | 16c79a3776c17965dedab4732d925f6098df91c1 (diff) |
ARM: 8031/1: fixmap: remove FIX_KMAP_BEGIN and FIX_KMAP_END
It seems that these two macros are not used by non architecture
specific code. And on ARM FIX_KMAP_BEGIN equals zero.
This patch removes these two macros. Instead, using FIX_KMAP_NR_PTES to
tell the pte number belonged to fixmap mapping region. The code will
become clearer when I introduce a bugfix on fixmap mapping region.
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/fixmap.h | 5 | ||||
-rw-r--r-- | arch/arm/mm/highmem.c | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/arch/arm/include/asm/fixmap.h b/arch/arm/include/asm/fixmap.h index bbae919bceb4..be55ebc08ed4 100644 --- a/arch/arm/include/asm/fixmap.h +++ b/arch/arm/include/asm/fixmap.h | |||
@@ -17,8 +17,7 @@ | |||
17 | #define FIXADDR_TOP 0xfffe0000UL | 17 | #define FIXADDR_TOP 0xfffe0000UL |
18 | #define FIXADDR_SIZE (FIXADDR_TOP - FIXADDR_START) | 18 | #define FIXADDR_SIZE (FIXADDR_TOP - FIXADDR_START) |
19 | 19 | ||
20 | #define FIX_KMAP_BEGIN 0 | 20 | #define FIX_KMAP_NR_PTES (FIXADDR_SIZE >> PAGE_SHIFT) |
21 | #define FIX_KMAP_END (FIXADDR_SIZE >> PAGE_SHIFT) | ||
22 | 21 | ||
23 | #define __fix_to_virt(x) (FIXADDR_START + ((x) << PAGE_SHIFT)) | 22 | #define __fix_to_virt(x) (FIXADDR_START + ((x) << PAGE_SHIFT)) |
24 | #define __virt_to_fix(x) (((x) - FIXADDR_START) >> PAGE_SHIFT) | 23 | #define __virt_to_fix(x) (((x) - FIXADDR_START) >> PAGE_SHIFT) |
@@ -27,7 +26,7 @@ extern void __this_fixmap_does_not_exist(void); | |||
27 | 26 | ||
28 | static inline unsigned long fix_to_virt(const unsigned int idx) | 27 | static inline unsigned long fix_to_virt(const unsigned int idx) |
29 | { | 28 | { |
30 | if (idx >= FIX_KMAP_END) | 29 | if (idx >= FIX_KMAP_NR_PTES) |
31 | __this_fixmap_does_not_exist(); | 30 | __this_fixmap_does_not_exist(); |
32 | return __fix_to_virt(idx); | 31 | return __fix_to_virt(idx); |
33 | } | 32 | } |
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c index 21b9e1bf9b77..e05e8ad26ba5 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c | |||
@@ -63,7 +63,7 @@ void *kmap_atomic(struct page *page) | |||
63 | type = kmap_atomic_idx_push(); | 63 | type = kmap_atomic_idx_push(); |
64 | 64 | ||
65 | idx = type + KM_TYPE_NR * smp_processor_id(); | 65 | idx = type + KM_TYPE_NR * smp_processor_id(); |
66 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 66 | vaddr = __fix_to_virt(idx); |
67 | #ifdef CONFIG_DEBUG_HIGHMEM | 67 | #ifdef CONFIG_DEBUG_HIGHMEM |
68 | /* | 68 | /* |
69 | * With debugging enabled, kunmap_atomic forces that entry to 0. | 69 | * With debugging enabled, kunmap_atomic forces that entry to 0. |
@@ -94,7 +94,7 @@ void __kunmap_atomic(void *kvaddr) | |||
94 | if (cache_is_vivt()) | 94 | if (cache_is_vivt()) |
95 | __cpuc_flush_dcache_area((void *)vaddr, PAGE_SIZE); | 95 | __cpuc_flush_dcache_area((void *)vaddr, PAGE_SIZE); |
96 | #ifdef CONFIG_DEBUG_HIGHMEM | 96 | #ifdef CONFIG_DEBUG_HIGHMEM |
97 | BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx)); | 97 | BUG_ON(vaddr != __fix_to_virt(idx)); |
98 | set_top_pte(vaddr, __pte(0)); | 98 | set_top_pte(vaddr, __pte(0)); |
99 | #else | 99 | #else |
100 | (void) idx; /* to kill a warning */ | 100 | (void) idx; /* to kill a warning */ |
@@ -117,7 +117,7 @@ void *kmap_atomic_pfn(unsigned long pfn) | |||
117 | 117 | ||
118 | type = kmap_atomic_idx_push(); | 118 | type = kmap_atomic_idx_push(); |
119 | idx = type + KM_TYPE_NR * smp_processor_id(); | 119 | idx = type + KM_TYPE_NR * smp_processor_id(); |
120 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 120 | vaddr = __fix_to_virt(idx); |
121 | #ifdef CONFIG_DEBUG_HIGHMEM | 121 | #ifdef CONFIG_DEBUG_HIGHMEM |
122 | BUG_ON(!pte_none(get_top_pte(vaddr))); | 122 | BUG_ON(!pte_none(get_top_pte(vaddr))); |
123 | #endif | 123 | #endif |