From 144cf8647a831c96bce9c947671467d088d89d16 Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Wed, 27 Jun 2012 13:02:49 +0800 Subject: frv: remove the second parameter of kmap_atomic_primary() All callers of kmap_atomic_primary() use __KM_CACHE, so it can be removed safely, and __kmap_atomic_primary() only check if 'type' if __KM_CACHE or not, so 'type' can be changed to a boolean as well. Ditto for kunmap_atomic_primary()/__kunmap_atomic_primary(). Acked-by: Geert Uytterhoeven Signed-off-by: Cong Wang --- arch/frv/include/asm/highmem.h | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) (limited to 'arch/frv/include/asm/highmem.h') diff --git a/arch/frv/include/asm/highmem.h b/arch/frv/include/asm/highmem.h index 716956a5317b..b3adc93611f3 100644 --- a/arch/frv/include/asm/highmem.h +++ b/arch/frv/include/asm/highmem.h @@ -76,15 +76,16 @@ extern struct page *kmap_atomic_to_page(void *ptr); #ifndef __ASSEMBLY__ -#define __kmap_atomic_primary(type, paddr, ampr) \ +#define __kmap_atomic_primary(cached, paddr, ampr) \ ({ \ unsigned long damlr, dampr; \ \ dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \ \ - if (type != __KM_CACHE) \ + if (!cached) \ asm volatile("movgs %0,dampr"#ampr :: "r"(dampr) : "memory"); \ else \ + /* cache flush page attachment point */ \ asm volatile("movgs %0,iampr"#ampr"\n" \ "movgs %0,dampr"#ampr"\n" \ :: "r"(dampr) : "memory" \ @@ -112,29 +113,20 @@ extern struct page *kmap_atomic_to_page(void *ptr); (void *) damlr; \ }) -static inline void *kmap_atomic_primary(struct page *page, enum km_type type) +static inline void *kmap_atomic_primary(struct page *page) { unsigned long paddr; pagefault_disable(); paddr = page_to_phys(page); - switch (type) { - case 0: return __kmap_atomic_primary(0, paddr, 2); - case 1: return __kmap_atomic_primary(1, paddr, 3); - case 2: return __kmap_atomic_primary(2, paddr, 4); - case 3: return __kmap_atomic_primary(3, paddr, 5); - - default: - BUG(); - return NULL; - } + return __kmap_atomic_primary(1, paddr, 2); } -#define __kunmap_atomic_primary(type, ampr) \ +#define __kunmap_atomic_primary(cached, ampr) \ do { \ asm volatile("movgs gr0,dampr"#ampr"\n" ::: "memory"); \ - if (type == __KM_CACHE) \ + if (cached) \ asm volatile("movgs gr0,iampr"#ampr"\n" ::: "memory"); \ } while(0) @@ -143,17 +135,9 @@ do { \ asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr) : "memory"); \ } while(0) -static inline void kunmap_atomic_primary(void *kvaddr, enum km_type type) +static inline void kunmap_atomic_primary(void *kvaddr) { - switch (type) { - case 0: __kunmap_atomic_primary(0, 2); break; - case 1: __kunmap_atomic_primary(1, 3); break; - case 2: __kunmap_atomic_primary(2, 4); break; - case 3: __kunmap_atomic_primary(3, 5); break; - - default: - BUG(); - } + __kunmap_atomic_primary(1, 2); pagefault_enable(); } -- cgit v1.2.1