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

From: Segher Boessenkool
Date: Fri Dec 04 2009 - 14:55:49 EST


>>> static inline unsigned char readb(const volatile void __iomem *addr) {
>>
>> This "volatile" is meaningless.
>
> Wrong. "volatile" here is an assertion that it is safe to pass pointer
> to a volatile object to this function.

Yes, sorry. What I meant is: this volatile has no effect on what
the rest of the function does.

> Either way, it works, it is guaranteed to be safe, and removing it can
> only introduce bugs, not remove them.

Oh definitely, I wasn't suggesting otherwise.


Segher

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