From: Brian Norris <computersforpeace@gmail.com>
To: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Rob Herring <robh@kernel.org>,
David Woodhouse <dwmw2@infradead.org>,
linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: nand: pxa3xx: fix build on ARM64
Date: Fri, 6 Feb 2015 10:43:47 -0800 [thread overview]
Message-ID: <20150206184347.GM18140@ld-irv-0074> (raw)
In-Reply-To: <54D508BA.7000606@free-electrons.com>
On Fri, Feb 06, 2015 at 03:32:26PM -0300, Ezequiel Garcia wrote:
> On 02/03/2015 08:06 PM, Rob Herring wrote:
> [..]
> > @@ -1580,7 +1580,7 @@ static int alloc_nand_resource(struct platform_device *pdev)
> > info->pdev = pdev;
> > info->variant = pxa3xx_nand_get_variant(pdev);
> > for (cs = 0; cs < pdata->num_cs; cs++) {
> > - mtd = (struct mtd_info *)((unsigned int)&info[1] +
> > + mtd = (struct mtd_info *)((void *)&info[1] +
> > (sizeof(*mtd) + sizeof(*host)) * cs);
> > chip = (struct nand_chip *)(&mtd[1]);
> > host = (struct pxa3xx_nand_host *)chip;
> >
>
> Those casts are an eyesore to me.
I suppose the (struct mtd_info *) cast is unecessary now, since the
(void *) will be implicitly casted just fine. But I'm not sure if it's
worth dropping it.
> Is this change related to the patch?
I believe the (void *) cast is a necessary change because
sizeof(pointer) != sizeof(unsigned int) on a 64-bit arch, so the
(unsigned int) cast would (rightly) generate a warning about the unsafe
cast. You're losing the top 32 bits.
Brian
next prev parent reply other threads:[~2015-02-06 18:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-03 23:06 [PATCH] mtd: nand: pxa3xx: fix build on ARM64 Rob Herring
2015-02-06 0:51 ` Brian Norris
2015-02-06 18:32 ` Ezequiel Garcia
2015-02-06 18:43 ` Brian Norris [this message]
2015-02-06 18:57 ` Ezequiel Garcia
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=20150206184347.GM18140@ld-irv-0074 \
--to=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=ezequiel.garcia@free-electrons.com \
--cc=linux-mtd@lists.infradead.org \
--cc=robh@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