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

Configure Feed

Select the types of activity you want to include in your feed.

dmascc: use proper 'virt_to_bus()' rather than casting to 'int'

The old dmascc driver depends on the legacy ISA_DMA_API, and blindly
just casts the kernel virtual address to 'int' for set_dma_addr().

That works only incidentally, and because the high bits of the address
will be ignored anyway. And on 64-bit architectures it causes warnings.

Admittedly, 64-bit architectures with ISA are basically dead - I think
the only example of this is alpha, and nobody would ever use the dmascc
driver there. But hey, the fix is easy enough, the end result is
cleaner, and it's yet another configuration that now builds without
warnings.

If somebody actually uses this driver on an alpha and this fixes it for
you, please email me. Because that is just incredibly bizarre.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+3 -3
+3 -3
drivers/net/hamradio/dmascc.c
··· 973 973 flags = claim_dma_lock(); 974 974 set_dma_mode(priv->param.dma, DMA_MODE_WRITE); 975 975 set_dma_addr(priv->param.dma, 976 - (int) priv->tx_buf[priv->tx_tail] + n); 976 + virt_to_bus(priv->tx_buf[priv->tx_tail]) + n); 977 977 set_dma_count(priv->param.dma, 978 978 priv->tx_len[priv->tx_tail] - n); 979 979 release_dma_lock(flags); ··· 1020 1020 flags = claim_dma_lock(); 1021 1021 set_dma_mode(priv->param.dma, DMA_MODE_READ); 1022 1022 set_dma_addr(priv->param.dma, 1023 - (int) priv->rx_buf[priv->rx_head]); 1023 + virt_to_bus(priv->rx_buf[priv->rx_head])); 1024 1024 set_dma_count(priv->param.dma, BUF_SIZE); 1025 1025 release_dma_lock(flags); 1026 1026 enable_dma(priv->param.dma); ··· 1233 1233 if (priv->param.dma >= 0) { 1234 1234 flags = claim_dma_lock(); 1235 1235 set_dma_addr(priv->param.dma, 1236 - (int) priv->rx_buf[priv->rx_head]); 1236 + virt_to_bus(priv->rx_buf[priv->rx_head])); 1237 1237 set_dma_count(priv->param.dma, BUF_SIZE); 1238 1238 release_dma_lock(flags); 1239 1239 } else {