Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 9386/2: mm: Use symbol alias for cache functions

The cache functions to flush user cache (*_flush_user_cache_all)
are in many cases just a branch to the corresponfing userspace or
kernelspace function. These functions also have the same arguments.

Simplify these by using SYM_FUNC_ALIAS() in all affected sites.

The NOP cache has very many similar calls which are just returns,
but it would be confusing to use aliases here, so leave all the
explicit returns and drop a comment on why we are not using aliases.

Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

authored by

Linus Walleij and committed by
Russell King (Oracle)
2074beeb 1036b895

+22 -54
+1 -3
arch/arm/mm/cache-fa.S
··· 52 52 * Clean and invalidate all cache entries in a particular address 53 53 * space. 54 54 */ 55 - SYM_TYPED_FUNC_START(fa_flush_user_cache_all) 56 - b fa_flush_kern_cache_all 57 - SYM_FUNC_END(fa_flush_user_cache_all) 55 + SYM_FUNC_ALIAS(fa_flush_user_cache_all, fa_flush_kern_cache_all) 58 56 59 57 /* 60 58 * flush_kern_cache_all()
+4
arch/arm/mm/cache-nop.S
··· 6 6 7 7 #include "proc-macros.S" 8 8 9 + /* 10 + * These are all open-coded instead of aliased, to make clear 11 + * what is going on here: all functions are stubbed out. 12 + */ 9 13 SYM_TYPED_FUNC_START(nop_flush_icache_all) 10 14 ret lr 11 15 SYM_FUNC_END(nop_flush_icache_all)
+1 -3
arch/arm/mm/cache-v4.S
··· 28 28 * 29 29 * - mm - mm_struct describing address space 30 30 */ 31 - SYM_TYPED_FUNC_START(v4_flush_user_cache_all) 32 - b v4_flush_kern_cache_all 33 - SYM_FUNC_END(v4_flush_user_cache_all) 31 + SYM_FUNC_ALIAS(v4_flush_user_cache_all, v4_flush_kern_cache_all) 34 32 35 33 /* 36 34 * flush_kern_cache_all()
+1 -3
arch/arm/mm/cache-v4wb.S
··· 66 66 * Clean and invalidate all cache entries in a particular address 67 67 * space. 68 68 */ 69 - SYM_TYPED_FUNC_START(v4wb_flush_user_cache_all) 70 - b v4wb_flush_kern_cache_all 71 - SYM_FUNC_END(v4wb_flush_user_cache_all) 69 + SYM_FUNC_ALIAS(v4wb_flush_user_cache_all, v4wb_flush_kern_cache_all) 72 70 73 71 /* 74 72 * flush_kern_cache_all()
+1 -3
arch/arm/mm/cache-v4wt.S
··· 56 56 * Invalidate all cache entries in a particular address 57 57 * space. 58 58 */ 59 - SYM_TYPED_FUNC_START(v4wt_flush_user_cache_all) 60 - b v4wt_flush_kern_cache_all 61 - SYM_FUNC_END(v4wt_flush_user_cache_all) 59 + SYM_FUNC_ALIAS(v4wt_flush_user_cache_all, v4wt_flush_kern_cache_all) 62 60 63 61 /* 64 62 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-arm1020.S
··· 127 127 * Invalidate all cache entries in a particular address 128 128 * space. 129 129 */ 130 - SYM_TYPED_FUNC_START(arm1020_flush_user_cache_all) 131 - b arm1020_flush_kern_cache_all 132 - SYM_FUNC_END(arm1020_flush_user_cache_all) 130 + SYM_FUNC_ALIAS(arm1020_flush_user_cache_all, arm1020_flush_kern_cache_all) 133 131 134 132 /* 135 133 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-arm1020e.S
··· 127 127 * Invalidate all cache entries in a particular address 128 128 * space. 129 129 */ 130 - SYM_TYPED_FUNC_START(arm1020e_flush_user_cache_all) 131 - b arm1020e_flush_kern_cache_all 132 - SYM_FUNC_END(arm1020e_flush_user_cache_all) 130 + SYM_FUNC_ALIAS(arm1020e_flush_user_cache_all, arm1020e_flush_kern_cache_all) 133 131 134 132 /* 135 133 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-arm1022.S
··· 127 127 * Invalidate all cache entries in a particular address 128 128 * space. 129 129 */ 130 - SYM_TYPED_FUNC_START(arm1022_flush_user_cache_all) 131 - b arm1022_flush_kern_cache_all 132 - SYM_FUNC_END(arm1022_flush_user_cache_all) 130 + SYM_FUNC_ALIAS(arm1022_flush_user_cache_all, arm1022_flush_kern_cache_all) 133 131 134 132 /* 135 133 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-arm1026.S
··· 127 127 * Invalidate all cache entries in a particular address 128 128 * space. 129 129 */ 130 - SYM_TYPED_FUNC_START(arm1026_flush_user_cache_all) 131 - b arm1026_flush_kern_cache_all 132 - SYM_FUNC_END(arm1026_flush_user_cache_all) 130 + SYM_FUNC_ALIAS(arm1026_flush_user_cache_all, arm1026_flush_kern_cache_all) 133 131 134 132 /* 135 133 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-arm920.S
··· 116 116 * Invalidate all cache entries in a particular address 117 117 * space. 118 118 */ 119 - SYM_TYPED_FUNC_START(arm920_flush_user_cache_all) 120 - b arm920_flush_kern_cache_all 121 - SYM_FUNC_END(arm920_flush_user_cache_all) 119 + SYM_FUNC_ALIAS(arm920_flush_user_cache_all, arm920_flush_kern_cache_all) 122 120 123 121 /* 124 122 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-arm922.S
··· 118 118 * Clean and invalidate all cache entries in a particular 119 119 * address space. 120 120 */ 121 - SYM_TYPED_FUNC_START(arm922_flush_user_cache_all) 122 - b arm922_flush_kern_cache_all 123 - SYM_FUNC_END(arm922_flush_user_cache_all) 121 + SYM_FUNC_ALIAS(arm922_flush_user_cache_all, arm922_flush_kern_cache_all) 124 122 125 123 /* 126 124 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-arm925.S
··· 151 151 * Clean and invalidate all cache entries in a particular 152 152 * address space. 153 153 */ 154 - SYM_TYPED_FUNC_START(arm925_flush_user_cache_all) 155 - b arm925_flush_kern_cache_all 156 - SYM_FUNC_END(arm925_flush_user_cache_all) 154 + SYM_FUNC_ALIAS(arm925_flush_user_cache_all, arm925_flush_kern_cache_all) 157 155 158 156 /* 159 157 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-arm926.S
··· 117 117 * Clean and invalidate all cache entries in a particular 118 118 * address space. 119 119 */ 120 - SYM_TYPED_FUNC_START(arm926_flush_user_cache_all) 121 - b arm926_flush_kern_cache_all 122 - SYM_FUNC_END(arm926_flush_user_cache_all) 120 + SYM_FUNC_ALIAS(arm926_flush_user_cache_all, arm926_flush_kern_cache_all) 123 121 124 122 /* 125 123 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-arm940.S
··· 81 81 /* 82 82 * flush_user_cache_all() 83 83 */ 84 - SYM_TYPED_FUNC_START(arm940_flush_user_cache_all) 85 - b arm940_flush_kern_cache_all 86 - SYM_FUNC_END(arm940_flush_user_cache_all) 84 + SYM_FUNC_ALIAS(arm940_flush_user_cache_all, arm940_flush_kern_cache_all) 87 85 88 86 /* 89 87 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-arm946.S
··· 88 88 /* 89 89 * flush_user_cache_all() 90 90 */ 91 - SYM_TYPED_FUNC_START(arm946_flush_user_cache_all) 92 - b arm946_flush_kern_cache_all 93 - SYM_FUNC_END(arm946_flush_user_cache_all) 91 + SYM_FUNC_ALIAS(arm946_flush_user_cache_all, arm946_flush_kern_cache_all) 94 92 95 93 /* 96 94 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-feroceon.S
··· 136 136 * address space. 137 137 */ 138 138 .align 5 139 - SYM_TYPED_FUNC_START(feroceon_flush_user_cache_all) 140 - b feroceon_flush_kern_cache_all 141 - SYM_FUNC_END(feroceon_flush_user_cache_all) 139 + SYM_FUNC_ALIAS(feroceon_flush_user_cache_all, feroceon_flush_kern_cache_all) 142 140 143 141 /* 144 142 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-mohawk.S
··· 100 100 * Clean and invalidate all cache entries in a particular 101 101 * address space. 102 102 */ 103 - SYM_TYPED_FUNC_START(mohawk_flush_user_cache_all) 104 - b mohawk_flush_kern_cache_all 105 - SYM_FUNC_END(mohawk_flush_user_cache_all) 103 + SYM_FUNC_ALIAS(mohawk_flush_user_cache_all, mohawk_flush_kern_cache_all) 106 104 107 105 /* 108 106 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-xsc3.S
··· 157 157 * Invalidate all cache entries in a particular address 158 158 * space. 159 159 */ 160 - SYM_TYPED_FUNC_START(xsc3_flush_user_cache_all) 161 - b xsc3_flush_kern_cache_all 162 - SYM_FUNC_END(xsc3_flush_user_cache_all) 160 + SYM_FUNC_ALIAS(xsc3_flush_user_cache_all, xsc3_flush_kern_cache_all) 163 161 164 162 /* 165 163 * flush_kern_cache_all()
+1 -3
arch/arm/mm/proc-xscale.S
··· 199 199 * Invalidate all cache entries in a particular address 200 200 * space. 201 201 */ 202 - SYM_TYPED_FUNC_START(xscale_flush_user_cache_all) 203 - b xscale_flush_kern_cache_all 204 - SYM_FUNC_END(xscale_flush_user_cache_all) 202 + SYM_FUNC_ALIAS(xscale_flush_user_cache_all, xscale_flush_kern_cache_all) 205 203 206 204 /* 207 205 * flush_kern_cache_all()