[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101120214820.GG8942@pengutronix.de>
Date: Sat, 20 Nov 2010 22:48:20 +0100
From: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>
Cc: linux-arm-kernel@...ts.infradead.org,
Patrice Vilchez <patrice.vilchez@...el.com>,
Nicolas Ferre <nicolas.ferre@...el.com>,
spi-devel-general@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/6] atmel_spi: fix warning In function
'atmel_spi_dma_map_xfer'
Hello,
[adding spi-devel-general and lkml to Cc:]
On Sat, Nov 20, 2010 at 11:08:53AM +0100, 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@...osoft.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 */
> +
> xfer->tx_dma = dma_map_single(dev,
> - (void *) xfer->tx_buf, xfer->len,
> + nonconst_tx, xfer->len,
> DMA_TO_DEVICE);
Hmm, I wonder if this is the right approach to do this. I'd prefer to
have something like:
dma_map_single_to_device(struct device *, const void *, ...)
don't know if that's sensible though.
And I wonder about gcc that your patch makes a difference.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists