Thread (24 messages) 24 messages, 1 author, 2016-02-04

[PATCH v6 21/23] powerpc: Simplify test in __dma_sync()

flat view
STALE3921d SUPERSEDED

From: Christophe Leroy <hidden>
Date: 2016-02-04 10:35:09
Also in: lkml
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

Status: Superseded by v8 (posted 2016-02-09). [go to v8]

Revision v6 (6 revisions archived).

Revisions (6)
  1. v2
  2. v3 [diff against previous]
  3. v5 [diff against previous]
  4. v6 current [diff against previous]
  5. v7 [diff against previous]
  6. v8 [diff against previous]
This simplification helps the compiler. We now have only one test
instead of two, so it reduces the number of branches.

Signed-off-by: Christophe Leroy <redacted>
---
v2: new
v3: no change
v4: no change
v5: no change
v6: no change

 arch/powerpc/mm/dma-noncoherent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/mm/dma-noncoherent.c b/arch/powerpc/mm/dma-noncoherent.c
index 169aba4..2dc74e5 100644
--- a/arch/powerpc/mm/dma-noncoherent.c
+++ b/arch/powerpc/mm/dma-noncoherent.c
@@ -327,7 +327,7 @@ void __dma_sync(void *vaddr, size_t size, int direction)
 		 * invalidate only when cache-line aligned otherwise there is
 		 * the potential for discarding uncommitted data from the cache
 		 */
-		if ((start & (L1_CACHE_BYTES - 1)) || (size & (L1_CACHE_BYTES - 1)))
+		if ((start | end) & (L1_CACHE_BYTES - 1))
 			flush_dcache_range(start, end);
 		else
 			invalidate_dcache_range(start, end);
-- 
2.1.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help