From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>,
Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [RESEND PATCH] gpio_addr_flash: Fix warnings
Date: Tue, 17 Nov 2009 16:58:44 +0000 [thread overview]
Message-ID: <20091117165844.0fb043f3@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <8bd0f97a0911170850x40f68e02y5a3d8ad39c4f9b90@mail.gmail.com>
On Tue, 17 Nov 2009 11:50:24 -0500
Mike Frysinger <vapier.adi@gmail.com> wrote:
> On Tue, Nov 17, 2009 at 10:46, Alan Cox wrote:
> > --- a/drivers/mtd/maps/gpio-addr-flash.c
> > +++ b/drivers/mtd/maps/gpio-addr-flash.c
> > - state->gpio_addrs = (void *)gpios->start;
> > + state->gpio_addrs = (void *)(unsigned long)gpios->start;
> > - state->map.virt = (void __iomem *)memory->start;
> > + state->map.virt = (void __iomem *)(unsigned long)memory->start;
>
> on what system do you see warnings ? start should be resource_size_t
> which should be phys_addr_t which should cast fine to a void*.
32bit x86 shows it up because resource_size_t is a physaddr_t which is
64bit (because of PAE). Now given you don't seem likely to be using the
top bits for any real world example that looks ok but really casting a
physical address to a pointer type needs care and the compiler can't
deduce your intent there.
next prev parent reply other threads:[~2009-11-17 16:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-17 15:46 Alan Cox
2009-11-17 16:50 ` Mike Frysinger
2009-11-17 16:58 ` Alan Cox [this message]
2009-11-17 23:21 ` Mike Frysinger
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=20091117165844.0fb043f3@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=alan@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vapier.adi@gmail.com \
/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
all inboxes | Powered by JetHome®