Re: Being more anal about iospace accesses..

From: Greg KH
Date: Wed Sep 15 2004 - 15:17:58 EST


On Wed, Sep 15, 2004 at 12:53:51PM -0700, Linus Torvalds wrote:
>
>
> On Wed, 15 Sep 2004, Greg KH wrote:
> >
> > Currently a few drivers do:
> > status = readl(&regs.status);
>
> I assume that's "&regs->status", since regs had better be a pointer..

Yes, sorry.

> > which causes sparse warnings.
> >
> > How should that code be changed to prevent this? Convert them all to
> > ioread32()? Or figure out a way to supress the warning for readl()?
>
> Just make sure that you annotate "regs" as a pointer to IO space.

Ah, ok, that works. Thanks for the clarification, I now realize that
__iomem can be a marker for any type of pointer, not just a void.
That's where I was confused.

thanks,

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