[PATCH 6/6] atmel_spi: fix warning In function 'atmel_spi_dma_map_xfer'

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sat Nov 20 09:01:31 EST 2010


On 14:54 Sat 20 Nov     , Sergei Shtylyov wrote:
> Hello.
> 
> On 20-11-2010 13:08, Jean-Christophe PLAGNIOL-VILLARD wrote:
> 
> >passing argument 2 of 'dma_map_single' discards qualifiers from pointer target type
> 
> >Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD<plagnioj at jcrosoft.com>
> >---
> >  drivers/spi/atmel_spi.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> >diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
> >index 154529a..2cf6abd 100644
> >--- a/drivers/spi/atmel_spi.c
> >+++ b/drivers/spi/atmel_spi.c
> >@@ -352,8 +352,10 @@ atmel_spi_dma_map_xfer(struct atmel_spi *as, struct spi_transfer *xfer)
> >
> >  	xfer->tx_dma = xfer->rx_dma = INVALID_DMA_ADDRESS;
> >  	if (xfer->tx_buf) {
> >+		void *nonconst_tx = (void *)xfer->tx_buf; /* shut up gcc */
> >+
> 
>    Aren't casts to 'void *' automatic?
no as the tx_buf is const void *

Best Regards,
J.



More information about the linux-arm-kernel mailing list