From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/6] atmel_spi: fix warning In function 'atmel_spi_dma_map_xfer'
Date: Sat, 20 Nov 2010 22:48:20 +0100	[thread overview]
Message-ID: <20101120214820.GG8942@pengutronix.de> (raw)
In-Reply-To: <1290247733-17834-6-git-send-email-plagnioj@jcrosoft.com>
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@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 */
> +
>  		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/  |
next prev parent reply	other threads:[~2010-11-20 21:48 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-20  9:59 rm9200: update Jean-Christophe PLAGNIOL-VILLARD
2010-11-20 10:08 ` [PATCH 1/6] at91: Convert remaining boards to new-style UART initialization Jean-Christophe PLAGNIOL-VILLARD
2010-11-20 10:08 ` [PATCH 2/6] at91rm9200dk: fix warning: 'dk_mmc_data' defined but not used Jean-Christophe PLAGNIOL-VILLARD
2010-11-20 10:08 ` [PATCH 3/6] at91rm9200ek: fix warning: 'ek_mmc_data' " Jean-Christophe PLAGNIOL-VILLARD
2010-11-20 10:08 ` [PATCH 4/6] at91/picotux200: fix warning: 'picotux200_mmc_data' " Jean-Christophe PLAGNIOL-VILLARD
2010-11-20 21:44   ` Uwe Kleine-König
2010-11-21  2:17     ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-20 10:08 ` [PATCH 5/6] at91: rename rm9200ek and rm9200dk board file name Jean-Christophe PLAGNIOL-VILLARD
2010-11-20 21:42   ` Uwe Kleine-König
2010-11-20 10:08 ` [PATCH 6/6] atmel_spi: fix warning In function 'atmel_spi_dma_map_xfer' Jean-Christophe PLAGNIOL-VILLARD
2010-11-20 11:54   ` Sergei Shtylyov
2010-11-20 14:01     ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-20 21:48   ` Uwe Kleine-König [this message]
2010-11-20 22:59     ` David Brownell
2010-11-21  2:19       ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-22 16:08 ` rm9200: update avictor.za at gmail.com
2010-11-24 14:34 ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-24 14:55   ` [PATCH 1/7 v2] at91: Convert remaining boards to new-style UART initialization Jean-Christophe PLAGNIOL-VILLARD
2010-11-24 14:55   ` [PATCH 2/7 v2] at91rm9200dk: fix warning: 'dk_mmc_data' defined but not used Jean-Christophe PLAGNIOL-VILLARD
2010-11-24 14:55   ` [PATCH 3/7 v2] at91rm9200ek: fix warning: 'ek_mmc_data' " Jean-Christophe PLAGNIOL-VILLARD
2010-11-24 14:55   ` [PATCH 4/7 v2] at91: rename rm9200ek and rm9200dk board file name Jean-Christophe PLAGNIOL-VILLARD
2010-11-24 14:55   ` [PATCH 5/7 v2] at91/picotux200: remove commenting usb device and dataflash support Jean-Christophe PLAGNIOL-VILLARD
2010-11-24 14:55   ` [PATCH 6/7] atmel_spi: fix warning In function 'atmel_spi_dma_map_xfer' Jean-Christophe PLAGNIOL-VILLARD
2010-11-24 14:55   ` [PATCH 7/7] at91/board-yl-9200: fix typo in video support Jean-Christophe PLAGNIOL-VILLARD
2010-11-24 15:31   ` rm9200: update Eric Bénard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=20101120214820.GG8942@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).