Skip to content

Commit

Permalink
powerpc: Simplify test in __dma_sync()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe Leroy authored and Scott Wood committed Mar 11, 2016
1 parent affe587 commit 8478d7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/mm/dma-noncoherent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8478d7f

Please sign in to comment.