From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] ARM: uniphier: refactor outer cache operation slightly
Date: Sun, 17 Jan 2016 10:13:16 +0900 [thread overview]
Message-ID: <1452993199-16824-2-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1452993199-16824-1-git-send-email-yamada.masahiro@socionext.com>
Improve readability without changing the behavior.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/mach-uniphier/cache_uniphier.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-uniphier/cache_uniphier.c b/arch/arm/mach-uniphier/cache_uniphier.c
index b4ca8b6..4a79966 100644
--- a/arch/arm/mach-uniphier/cache_uniphier.c
+++ b/arch/arm/mach-uniphier/cache_uniphier.c
@@ -67,7 +67,9 @@ static void uniphier_cache_maint_range(u32 start, u32 end, u32 operation)
*/
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 */
uniphier_cache_maint_all(operation);
return;
@@ -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,
* 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) {
u32 chunk_size = size > SSC_RANGE_OP_MAX_SIZE ?
--
1.9.1
next prev parent reply other threads:[~2016-01-17 1:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-17 1:13 [U-Boot] [PATCH 0/4] ARM: uniphier: refactor and fix UniPhier outer cache Masahiro Yamada
2016-01-17 1:13 ` Masahiro Yamada [this message]
2016-01-17 1:13 ` [U-Boot] [PATCH 2/4] ARM: uniphier: factor out outer cache sync as a helper function Masahiro Yamada
2016-01-17 1:13 ` [U-Boot] [PATCH 3/4] ARM: uniphier: fix range invalidate for outer cache Masahiro Yamada
2016-01-17 1:13 ` [U-Boot] [PATCH 4/4] ARM: uniphier: set active ways to really enable " Masahiro Yamada
2016-01-19 23:47 ` [U-Boot] [PATCH 0/4] ARM: uniphier: refactor and fix UniPhier " Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452993199-16824-2-git-send-email-yamada.masahiro@socionext.com \
--to=yamada.masahiro@socionext.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.