Re: [PATCH 1/5] Convert resource to u64 from unsigned long

Dave
2005-01-14T00:52:36Z

On Thu, 13 Jan 2005 16:43:58 -0800 (PST), Linus Torvalds
<torvalds@osdl.org> wrote:
>
>
> On Thu, 13 Jan 2005, Andrew Morton wrote:
> >
> > Also, the patches introduce tons of ifdefs such as:
> >
> > +#if BITS_PER_LONG == 64
> > return (void __iomem *)pci_resource_start(pdev, PCI_ROM_RESOURCE);
> > +#else
> > + return (void __iomem *)(u32)pci_resource_start(pdev, PCI_ROM_RESOURCE);
> > +#endif
>
> Ouch. Who does that, anyway? It's wrong to do that. It's not a pointer,
> not even an __iomem one. You'd need to do an ioremap() on it to turn it
> into a pointer.
>
> Linus
>

It's in the PCI option ROM code and at first it thew me just a bit
too. Apparently the resource.start is a kmalloc'd buffer and not
really an actual bus address. Is that a gross abuse of the way struct
resource is intended to be used?

--
-= Dave =-

Software Engineer - Advanced Development Engineering Team
Storage Component Division - Intel Corp.
mailto://dave.jiang @ intel
http://sourceforge.net/projects/xscaleiop/
----
The views expressed in this email are
mine alone and do not necessarily
reflect the views of my employer
(Intel Corp.).