On Mon, 21 Mar 2011 21:28:48 +0100, Randy Dunlap <rdunlap@xxxxxxxxxxxx>
wrote:
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code
***
Hi Randy,
One of the things I am facing in the code is the use of the volatile
keyword so I browsed another file in the Documentation folder:
volatile-considered-harmful.txt. As your name popped up I would like to
ask some questions. The register access macros in the brcmaxi module make
use of the accessor functions readb/w/l and writeb/w/l and the pointer
parameter is cast with volatile keyword, which I assume to be unneccessary
(reading the doc). Another instance uses it to avoid optimization. Here is
how the function is coded currently:
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.
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