Re: Should io(read|write)(8|16|32)_rep take (const|) volatile u(8|16|32) __iomem *addr?

H. Peter Anvin
2007-02-02T03:16:05Z

Michael K. Edwards wrote:
>
> It looks to me, by comparison to memcpy_(from|to)io, as if the
> volatiles ought to be there. It also looks to me like the void *
> parameters should be u(8|16|32) * instead, so the compiler knows what
> alignment to expect (the implementations would generally fail or suck
> on non-aligned arguments). (That would also be more consistent with
> the fact that the length parameters are in (8|16|32)-bit units, not
> octets.)
>
> Opinions?
>

The real question is whether or not gcc does anything sane with "const
volatile", which may incorrectly sound oxymoronic to some people (it's
not, const means "this element must not be written to" and volatile
means "reading or writing this element has side effects".)

I would argue the right thing to do is to do the patch assuming gcc is
sane, and let it sit in -mm for a kernel cycle or two.

-hpa