Skip to content
Snippets Groups Projects
Commit cefca48c authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

ARM: uniphier: refactor outer cache operation slightly


Improve readability without changing the behavior.

Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 25d4eb80
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,9 @@ static void uniphier_cache_maint_range(u32 start, u32 end, u32 operation) ...@@ -67,7 +67,9 @@ static void uniphier_cache_maint_range(u32 start, u32 end, u32 operation)
*/ */
start = start & ~(SSC_LINE_SIZE - 1); start = start & ~(SSC_LINE_SIZE - 1);
if (start == 0 && end >= (u32)(-SSC_LINE_SIZE)) { size = end - start;
if (unlikely(size >= (u32)(-SSC_LINE_SIZE))) {
/* this means cache operation for all range */ /* this means cache operation for all range */
uniphier_cache_maint_all(operation); uniphier_cache_maint_all(operation);
return; return;
...@@ -77,7 +79,7 @@ static void uniphier_cache_maint_range(u32 start, u32 end, u32 operation) ...@@ -77,7 +79,7 @@ static void uniphier_cache_maint_range(u32 start, u32 end, u32 operation)
* If end address is not aligned to cache-line, * If end address is not aligned to cache-line,
* do cache operation for the last cache-line * do cache operation for the last cache-line
*/ */
size = (end - start + SSC_LINE_SIZE - 1) & ~(SSC_LINE_SIZE - 1); size = ALIGN(size, SSC_LINE_SIZE);
while (size) { while (size) {
u32 chunk_size = size > SSC_RANGE_OP_MAX_SIZE ? u32 chunk_size = size > SSC_RANGE_OP_MAX_SIZE ?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment