powerpc: Simplify test in __dma_sync()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 9 Feb 2016 16:08:29 +0000 (17:08 +0100)
committerScott Wood <oss@buserror.net>
Fri, 11 Mar 2016 23:20:12 +0000 (17:20 -0600)
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 <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <oss@buserror.net>
arch/powerpc/mm/dma-noncoherent.c

index 169aba4..2dc74e5 100644 (file)
@@ -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);