From: Jingoo Han <jg1.han@samsung.com>
To: 'Joe Perches' <joe@perches.com>
Cc: 'Mark Brown' <broonie@kernel.org>,
linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
Jingoo Han <jg1.han@samsung.com>
Subject: Re: [PATCH V2 2/2] spi: s3c64xx: fix checkpatch error and warnings
Date: Tue, 16 Jul 2013 08:40:13 +0900 [thread overview]
Message-ID: <003201ce81b4$a72e2a40$f58a7ec0$@samsung.com> (raw)
In-Reply-To: <1373931428.2062.51.camel@joe-AO722>
On Monday, Tuesday, July 16, 2013 8:37 AM, Joe Perches wrote:
> On Tue, 2013-07-16 at 08:23 +0900, Jingoo Han wrote:
> > On Monday, July 15, 2013 9:10 PM, Joe Perches wrote:
> > > On Mon, 2013-07-15 at 15:11 +0900, Jingoo Han wrote:
> > > []
> > > > diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> > > []
> > > > @@ -338,8 +338,10 @@ static int acquire_dma(struct s3c64xx_spi_driver_data *sdd)
> > > []
> > > > - sdd->rx_dma.ch = (void *)sdd->ops->request(sdd->rx_dma.dmach, &req, dev, "rx");
> > > > - sdd->tx_dma.ch = (void *)sdd->ops->request(sdd->tx_dma.dmach, &req, dev, "tx");
> > > > + sdd->rx_dma.ch = (void *)sdd->ops->request(sdd->rx_dma.dmach,
> > > > + &req, dev, "rx");
> > > > + sdd->tx_dma.ch = (void *)sdd->ops->request(sdd->tx_dma.dmach,
> > > > + &req, dev, "tx");
> > >
> > > There should be sparse errors here.
> > > sdd->ops->request is unsigned int, not unsigned long.
> > > Care to fix the cast of unsigned to pointer too?
> >
> > OK, I will fix it as below:
> >
> > sdd->rx_dma.ch = (unsigned long *)sdd->ops->request(sdd->rx_dma.dmach,
> > &req, dev, "rx");
> > sdd->tx_dma.ch = (unsigned long *)sdd->ops->request(sdd->tx_dma.dmach,
> > &req, dev, "tx");
>
> Which should give you a different error.
>
> The canonical (Small C, not the Ubuntu company)
> way to do this is to first cast to unsigned long
> then cast to pointer type.
>
> sdd->tx_dma.ch = (unsigned long *)(unsigned long)sdd->ops->request(etc...)
Oh, sorry.
I will fix it as you guide, and send v4 patch, soon.
I really appreciate your kind guidance. :)
Best regards,
Jingoo Han
>
> > > It seems unsigned to pointer conversions are pretty
> > > rampant in this code.
> >
> > It seems so.
> > I will look into it, later.
>
> No worries. Whenever you get 'round to it.
prev parent reply other threads:[~2013-07-15 23:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 6:11 [PATCH V2 2/2] spi: s3c64xx: fix checkpatch error and warnings Jingoo Han
2013-07-15 12:00 ` Mark Brown
2013-07-15 12:10 ` Joe Perches
2013-07-15 23:23 ` Jingoo Han
2013-07-15 23:37 ` Joe Perches
2013-07-15 23:40 ` Jingoo Han [this message]
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='003201ce81b4$a72e2a40$f58a7ec0$@samsung.com' \
--to=jg1.han@samsung.com \
--cc=broonie@kernel.org \
--cc=joe@perches.com \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-spi@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