On Wed, 23 Mar 2011 14:49:43 +0100, Michael BÃsch <mb@xxxxxxxxx> wrote:
void foobar(void *r, u32 val)
{
volatile u32 dummy;
WR_REG(r, val);
dummy = RD_REG(r);
}
The register read is necessary to assure the register write is properly
flushed out in hardware. Could removing the volatile for the dummy
variable cause removal of the register read due to code optimization.
It shouldn't optimize the read away as long as the RD_REG uses a
volatile pointer internally. Which is the case if you use readl/w/b or
ioread... to implement RD_REG
Well, RD_REG(r) is a macro which translates to readb((volatile u8*)r). Are
you referring to that being a volatile pointer or do you mean that inside
the accessor function readb the 'r' parameter is treated as a volatile
pointer.
Gr. AvS
--
"The most merciful thing in the world, I think, is the inability of the
human
mind to correlate all its contents." - "The Call of Cthulhu"
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html