Re: x86: Is 'volatile' necessary for readb/writeb and friends?

From: Arnd Bergmann
Date: Fri Dec 04 2009 - 11:00:59 EST


On Friday 04 December 2009, Segher Boessenkool wrote:
> If you want to get all language-lawyery, if the object pointed to by
> "addr" is volatile, the volatile here is needed: accessing volatile
> objects via a not volatile-qualified lvalue is undefined. But since
> this is GCC-specific code anyway, do you care? :-)

I think the real reason for having it is to avoid a warning when
device drivers pass volatile objects. Not sure if that's a good
thing or if we should better actually warn about it.

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