Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] Move ISA DMA bus_to_virt() out of set_dma_addr()

Allow the compiler to optimise the bus_to_virt(virt_to_bus())
transformation in the ARM ISA DMA interface.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Russell King and committed by
Russell King
333c9624 109a9378

+7 -5
+4 -4
arch/arm/kernel/dma.c
··· 131 131 * 132 132 * Copy address to the structure, and set the invalid bit 133 133 */ 134 - void set_dma_addr (dmach_t channel, unsigned long physaddr) 134 + void __set_dma_addr (dmach_t channel, void *addr) 135 135 { 136 136 dma_t *dma = dma_chan + channel; 137 137 ··· 141 141 142 142 dma->sg = &dma->buf; 143 143 dma->sgcount = 1; 144 - dma->buf.__address = bus_to_virt(physaddr); 144 + dma->buf.__address = addr; 145 145 dma->using_sg = 0; 146 146 dma->invalid = 1; 147 147 } ··· 278 278 GLOBAL_ALIAS(set_dma_mode, get_dma_residue); 279 279 GLOBAL_ALIAS(set_dma_page, get_dma_residue); 280 280 GLOBAL_ALIAS(set_dma_count, get_dma_residue); 281 - GLOBAL_ALIAS(set_dma_addr, get_dma_residue); 281 + GLOBAL_ALIAS(__set_dma_addr, get_dma_residue); 282 282 GLOBAL_ALIAS(set_dma_sg, get_dma_residue); 283 283 GLOBAL_ALIAS(set_dma_speed, get_dma_residue); 284 284 GLOBAL_ALIAS(init_dma, get_dma_residue); ··· 289 289 EXPORT_SYMBOL(free_dma); 290 290 EXPORT_SYMBOL(enable_dma); 291 291 EXPORT_SYMBOL(disable_dma); 292 - EXPORT_SYMBOL(set_dma_addr); 292 + EXPORT_SYMBOL(__set_dma_addr); 293 293 EXPORT_SYMBOL(set_dma_count); 294 294 EXPORT_SYMBOL(set_dma_mode); 295 295 EXPORT_SYMBOL(set_dma_page);
+3 -1
include/asm-arm/dma.h
··· 91 91 * especially since some DMA architectures don't update the 92 92 * DMA address immediately, but defer it to the enable_dma(). 93 93 */ 94 - extern void set_dma_addr(dmach_t channel, unsigned long physaddr); 94 + extern void __set_dma_addr(dmach_t channel, void *addr); 95 + #define set_dma_addr(channel, addr) \ 96 + __set_dma_addr(channel, bus_to_virt(addr)) 95 97 96 98 /* Set the DMA byte count for this channel 97 99 *