mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									16c79a3776
								
							
						
					
					
						commit
						4221e2e6b3
					
				
					 2 changed files with 5 additions and 6 deletions
				
			
		| 
						 | 
					@ -17,8 +17,7 @@
 | 
				
			||||||
#define FIXADDR_TOP		0xfffe0000UL
 | 
					#define FIXADDR_TOP		0xfffe0000UL
 | 
				
			||||||
#define FIXADDR_SIZE		(FIXADDR_TOP - FIXADDR_START)
 | 
					#define FIXADDR_SIZE		(FIXADDR_TOP - FIXADDR_START)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define FIX_KMAP_BEGIN		0
 | 
					#define FIX_KMAP_NR_PTES	(FIXADDR_SIZE >> PAGE_SHIFT)
 | 
				
			||||||
#define FIX_KMAP_END		(FIXADDR_SIZE >> PAGE_SHIFT)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define __fix_to_virt(x)	(FIXADDR_START + ((x) << PAGE_SHIFT))
 | 
					#define __fix_to_virt(x)	(FIXADDR_START + ((x) << PAGE_SHIFT))
 | 
				
			||||||
#define __virt_to_fix(x)	(((x) - FIXADDR_START) >> PAGE_SHIFT)
 | 
					#define __virt_to_fix(x)	(((x) - FIXADDR_START) >> PAGE_SHIFT)
 | 
				
			||||||
| 
						 | 
					@ -27,7 +26,7 @@ extern void __this_fixmap_does_not_exist(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline unsigned long fix_to_virt(const unsigned int idx)
 | 
					static inline unsigned long fix_to_virt(const unsigned int idx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (idx >= FIX_KMAP_END)
 | 
						if (idx >= FIX_KMAP_NR_PTES)
 | 
				
			||||||
		__this_fixmap_does_not_exist();
 | 
							__this_fixmap_does_not_exist();
 | 
				
			||||||
	return __fix_to_virt(idx);
 | 
						return __fix_to_virt(idx);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -63,7 +63,7 @@ void *kmap_atomic(struct page *page)
 | 
				
			||||||
	type = kmap_atomic_idx_push();
 | 
						type = kmap_atomic_idx_push();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	idx = type + KM_TYPE_NR * smp_processor_id();
 | 
						idx = type + KM_TYPE_NR * smp_processor_id();
 | 
				
			||||||
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
 | 
						vaddr = __fix_to_virt(idx);
 | 
				
			||||||
#ifdef CONFIG_DEBUG_HIGHMEM
 | 
					#ifdef CONFIG_DEBUG_HIGHMEM
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * With debugging enabled, kunmap_atomic forces that entry to 0.
 | 
						 * With debugging enabled, kunmap_atomic forces that entry to 0.
 | 
				
			||||||
| 
						 | 
					@ -94,7 +94,7 @@ void __kunmap_atomic(void *kvaddr)
 | 
				
			||||||
		if (cache_is_vivt())
 | 
							if (cache_is_vivt())
 | 
				
			||||||
			__cpuc_flush_dcache_area((void *)vaddr, PAGE_SIZE);
 | 
								__cpuc_flush_dcache_area((void *)vaddr, PAGE_SIZE);
 | 
				
			||||||
#ifdef CONFIG_DEBUG_HIGHMEM
 | 
					#ifdef CONFIG_DEBUG_HIGHMEM
 | 
				
			||||||
		BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
 | 
							BUG_ON(vaddr != __fix_to_virt(idx));
 | 
				
			||||||
		set_top_pte(vaddr, __pte(0));
 | 
							set_top_pte(vaddr, __pte(0));
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
		(void) idx;  /* to kill a warning */
 | 
							(void) idx;  /* to kill a warning */
 | 
				
			||||||
| 
						 | 
					@ -117,7 +117,7 @@ void *kmap_atomic_pfn(unsigned long pfn)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	type = kmap_atomic_idx_push();
 | 
						type = kmap_atomic_idx_push();
 | 
				
			||||||
	idx = type + KM_TYPE_NR * smp_processor_id();
 | 
						idx = type + KM_TYPE_NR * smp_processor_id();
 | 
				
			||||||
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
 | 
						vaddr = __fix_to_virt(idx);
 | 
				
			||||||
#ifdef CONFIG_DEBUG_HIGHMEM
 | 
					#ifdef CONFIG_DEBUG_HIGHMEM
 | 
				
			||||||
	BUG_ON(!pte_none(get_top_pte(vaddr)));
 | 
						BUG_ON(!pte_none(get_top_pte(vaddr)));
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue