]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
MIPS: mm: Move some checks out of 'for' loop in DMA operations
authorJayachandran C <jchandra@broadcom.com>
Wed, 25 Sep 2013 13:01:05 +0000 (18:31 +0530)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 25 Sep 2013 15:05:44 +0000 (17:05 +0200)
commit55c25c2f14496badefd780a9f179442756216b67
treec29c3c8e3456328acdcd6f6d26079948eaad0429
parentbecee6b8c7b2b4adc9a3e0bec633abecd591b9ef
MIPS: mm: Move some checks out of 'for' loop in DMA operations

The check cpu_needs_post_dma_flush() in mips_dma_sync_sg_for_cpu() and
the check !plat_device_is_coherent() in mips_dma_sync_sg_for_device()
can be moved outside the for loop.

As a side effect, this also avoids a GCC bug that caused kernel compile
to fail with the error:

arch/mips/mm/dma-default.c: In function 'mips_dma_sync_sg_for_cpu':
arch/mips/mm/dma-default.c:316:1: internal compiler error: in add_insn_before, at emit-rtl.c:3852

This gcc failure is seen in Code Sourcery toolchains [e.g. gcc version
4.7.2 (Sourcery CodeBench Lite 2012.09-99)] after commit "MIPS: Optimize
current_cpu_type() for better code."

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5907/
Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>
Tested-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/mm/dma-default.c