From: Brian Norris <computersforpeace@gmail.com>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
linux-mtd@lists.infradead.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH] mtd: sh_flctl: Fix warnings due to improper casts
Date: Tue, 26 Nov 2013 18:11:40 -0800 [thread overview]
Message-ID: <20131127021140.GV9468@ld-irv-0074.broadcom.com> (raw)
In-Reply-To: <1385512511-10477-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
On Wed, Nov 27, 2013 at 01:35:11AM +0100, Laurent Pinchart wrote:
> Cast pointers to unsigned long instead of unsigned int. This fixes
> warnings on platforms where pointers have a different size than int.
>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: linux-mtd@lists.infradead.org
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> drivers/mtd/nand/sh_flctl.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
> index a3c84eb..b1e2b13 100644
> --- a/drivers/mtd/nand/sh_flctl.c
> +++ b/drivers/mtd/nand/sh_flctl.c
> @@ -151,7 +151,7 @@ static void flctl_setup_dma(struct sh_flctl *flctl)
> dma_cap_set(DMA_SLAVE, mask);
>
> flctl->chan_fifo0_tx = dma_request_channel(mask, shdma_chan_filter,
> - (void *)pdata->slave_id_fifo0_tx);
> + (void *)(unsigned long)pdata->slave_id_fifo0_tx);
Perhaps the intermediate cast should be for uintptr_t instead of
unsigned long, just to be more exact? (I see that uintptr_t is just
typedef'd for unsigned long, but it still seems more precise.)
> dev_dbg(&pdev->dev, "%s: TX: got channel %p\n", __func__,
> flctl->chan_fifo0_tx);
>
> @@ -168,7 +168,7 @@ static void flctl_setup_dma(struct sh_flctl *flctl)
> goto err;
>
> flctl->chan_fifo0_rx = dma_request_channel(mask, shdma_chan_filter,
> - (void *)pdata->slave_id_fifo0_rx);
> + (void *)(unsigned long)pdata->slave_id_fifo0_rx);
Ditto.
> dev_dbg(&pdev->dev, "%s: RX: got channel %p\n", __func__,
> flctl->chan_fifo0_rx);
>
Brian
next prev parent reply other threads:[~2013-11-27 2:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-27 0:35 [PATCH] mtd: sh_flctl: Fix warnings due to improper casts Laurent Pinchart
2013-11-27 2:11 ` Brian Norris [this message]
2013-11-27 10:04 ` Laurent Pinchart
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=20131127021140.GV9468@ld-irv-0074.broadcom.com \
--to=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-sh@vger.kernel.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