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

From: H. Peter Anvin
Date: Thu Feb 01 2007 - 22:16:39 EST


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
-
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/