Skip to content

Commit 2074bee

Browse files
linuswRussell King (Oracle)
authored andcommitted
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 <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 1036b89 commit 2074bee

19 files changed

+22
-54
lines changed

arch/arm/mm/cache-fa.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ SYM_FUNC_END(fa_flush_icache_all)
5252
* Clean and invalidate all cache entries in a particular address
5353
* space.
5454
*/
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)
5856

5957
/*
6058
* flush_kern_cache_all()

arch/arm/mm/cache-nop.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
#include "proc-macros.S"
88

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+
*/
913
SYM_TYPED_FUNC_START(nop_flush_icache_all)
1014
ret lr
1115
SYM_FUNC_END(nop_flush_icache_all)

arch/arm/mm/cache-v4.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ SYM_FUNC_END(v4_flush_icache_all)
2828
*
2929
* - mm - mm_struct describing address space
3030
*/
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)
3432

3533
/*
3634
* flush_kern_cache_all()

arch/arm/mm/cache-v4wb.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ SYM_FUNC_END(v4wb_flush_icache_all)
6666
* Clean and invalidate all cache entries in a particular address
6767
* space.
6868
*/
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)
7270

7371
/*
7472
* flush_kern_cache_all()

arch/arm/mm/cache-v4wt.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ SYM_FUNC_END(v4wt_flush_icache_all)
5656
* Invalidate all cache entries in a particular address
5757
* space.
5858
*/
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)
6260

6361
/*
6462
* flush_kern_cache_all()

arch/arm/mm/proc-arm1020.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ SYM_FUNC_END(arm1020_flush_icache_all)
127127
* Invalidate all cache entries in a particular address
128128
* space.
129129
*/
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)
133131

134132
/*
135133
* flush_kern_cache_all()

arch/arm/mm/proc-arm1020e.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ SYM_FUNC_END(arm1020e_flush_icache_all)
127127
* Invalidate all cache entries in a particular address
128128
* space.
129129
*/
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)
133131

134132
/*
135133
* flush_kern_cache_all()

arch/arm/mm/proc-arm1022.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ SYM_FUNC_END(arm1022_flush_icache_all)
127127
* Invalidate all cache entries in a particular address
128128
* space.
129129
*/
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)
133131

134132
/*
135133
* flush_kern_cache_all()

arch/arm/mm/proc-arm1026.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ SYM_FUNC_END(arm1026_flush_icache_all)
127127
* Invalidate all cache entries in a particular address
128128
* space.
129129
*/
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)
133131

134132
/*
135133
* flush_kern_cache_all()

arch/arm/mm/proc-arm920.S

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ SYM_FUNC_END(arm920_flush_icache_all)
116116
* Invalidate all cache entries in a particular address
117117
* space.
118118
*/
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)
122120

123121
/*
124122
* flush_kern_cache_all()

0 commit comments

Comments
 (0)