Skip to content

Commit 4221e2e

Browse files
aarch64Russell King
authored andcommitted
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>
1 parent 16c79a3 commit 4221e2e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

arch/arm/include/asm/fixmap.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
#define FIXADDR_TOP 0xfffe0000UL
1818
#define FIXADDR_SIZE (FIXADDR_TOP - FIXADDR_START)
1919

20-
#define FIX_KMAP_BEGIN 0
21-
#define FIX_KMAP_END (FIXADDR_SIZE >> PAGE_SHIFT)
20+
#define FIX_KMAP_NR_PTES (FIXADDR_SIZE >> PAGE_SHIFT)
2221

2322
#define __fix_to_virt(x) (FIXADDR_START + ((x) << PAGE_SHIFT))
2423
#define __virt_to_fix(x) (((x) - FIXADDR_START) >> PAGE_SHIFT)
@@ -27,7 +26,7 @@ extern void __this_fixmap_does_not_exist(void);
2726

2827
static inline unsigned long fix_to_virt(const unsigned int idx)
2928
{
30-
if (idx >= FIX_KMAP_END)
29+
if (idx >= FIX_KMAP_NR_PTES)
3130
__this_fixmap_does_not_exist();
3231
return __fix_to_virt(idx);
3332
}

arch/arm/mm/highmem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void *kmap_atomic(struct page *page)
6363
type = kmap_atomic_idx_push();
6464

6565
idx = type + KM_TYPE_NR * smp_processor_id();
66-
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
66+
vaddr = __fix_to_virt(idx);
6767
#ifdef CONFIG_DEBUG_HIGHMEM
6868
/*
6969
* With debugging enabled, kunmap_atomic forces that entry to 0.
@@ -94,7 +94,7 @@ void __kunmap_atomic(void *kvaddr)
9494
if (cache_is_vivt())
9595
__cpuc_flush_dcache_area((void *)vaddr, PAGE_SIZE);
9696
#ifdef CONFIG_DEBUG_HIGHMEM
97-
BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
97+
BUG_ON(vaddr != __fix_to_virt(idx));
9898
set_top_pte(vaddr, __pte(0));
9999
#else
100100
(void) idx; /* to kill a warning */
@@ -117,7 +117,7 @@ void *kmap_atomic_pfn(unsigned long pfn)
117117

118118
type = kmap_atomic_idx_push();
119119
idx = type + KM_TYPE_NR * smp_processor_id();
120-
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
120+
vaddr = __fix_to_virt(idx);
121121
#ifdef CONFIG_DEBUG_HIGHMEM
122122
BUG_ON(!pte_none(get_top_pte(vaddr)));
123123
#endif

0 commit comments

Comments
 (0)