diff options
author | Michal Simek <michal.simek@xilinx.com> | 2013-06-03 05:30:04 -0400 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2013-06-03 05:33:23 -0400 |
commit | 62bc82a82bb1e2b5ee5048c088af7260ddb2b7b5 (patch) | |
tree | e2225f62cc0ab404471a62d7a287b74d07995d5a | |
parent | 8706a6b6303dd75c7ee2baf2161de0f5a2fbdd8b (diff) |
microblaze: Use static inline functions in cacheflush.h
Using static inline functions ensure proper type checking
which also remove compilation warning for no MMU
Compilation warning:
arch/microblaze/include/asm/cacheflush.h: warning: 'addr'
may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
-rw-r--r-- | arch/microblaze/include/asm/cacheflush.h | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/arch/microblaze/include/asm/cacheflush.h b/arch/microblaze/include/asm/cacheflush.h index 0f553bc009a0..ffea82a16d2c 100644 --- a/arch/microblaze/include/asm/cacheflush.h +++ b/arch/microblaze/include/asm/cacheflush.h | |||
@@ -102,21 +102,23 @@ do { \ | |||
102 | 102 | ||
103 | #define flush_cache_range(vma, start, len) do { } while (0) | 103 | #define flush_cache_range(vma, start, len) do { } while (0) |
104 | 104 | ||
105 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | 105 | static inline void copy_to_user_page(struct vm_area_struct *vma, |
106 | do { \ | 106 | struct page *page, unsigned long vaddr, |
107 | u32 addr = virt_to_phys(dst); \ | 107 | void *dst, void *src, int len) |
108 | memcpy((dst), (src), (len)); \ | 108 | { |
109 | if (vma->vm_flags & VM_EXEC) { \ | 109 | u32 addr = virt_to_phys(dst); |
110 | invalidate_icache_range((unsigned) (addr), \ | 110 | memcpy(dst, src, len); |
111 | (unsigned) (addr) + PAGE_SIZE); \ | 111 | if (vma->vm_flags & VM_EXEC) { |
112 | flush_dcache_range((unsigned) (addr), \ | 112 | invalidate_icache_range(addr, addr + PAGE_SIZE); |
113 | (unsigned) (addr) + PAGE_SIZE); \ | 113 | flush_dcache_range(addr, addr + PAGE_SIZE); |
114 | } \ | 114 | } |
115 | } while (0) | 115 | } |
116 | 116 | ||
117 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 117 | static inline void copy_from_user_page(struct vm_area_struct *vma, |
118 | do { \ | 118 | struct page *page, unsigned long vaddr, |
119 | memcpy((dst), (src), (len)); \ | 119 | void *dst, void *src, int len) |
120 | } while (0) | 120 | { |
121 | memcpy(dst, src, len); | ||
122 | } | ||
121 | 123 | ||
122 | #endif /* _ASM_MICROBLAZE_CACHEFLUSH_H */ | 124 | #endif /* _ASM_MICROBLAZE_CACHEFLUSH_H */ |