lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091117165844.0fb043f3@lxorguk.ukuu.org.uk>
Date:	Tue, 17 Nov 2009 16:58:44 +0000
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Mike Frysinger <vapier.adi@...il.com>
Cc:	Alan Cox <alan@...ux.intel.com>,
	Linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: [RESEND PATCH] gpio_addr_flash: Fix warnings

On Tue, 17 Nov 2009 11:50:24 -0500
Mike Frysinger <vapier.adi@...il.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.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ