Cc: Stefan Richter <stefanr@...>, Christoph Lameter <clameter@...>, Chris Snook <csnook@...>, Linux Kernel Mailing List <linux-kernel@...>, <linux-arch@...>, Linus Torvalds <torvalds@...>, <netdev@...>, Andrew Morton <akpm@...>, <ak@...>, <heiko.carstens@...>, <davem@...>, <schwidefsky@...>, <wensong@...>, <horms@...>, <wjiang@...>, <cfriesen@...>, <zlynx@...>, <rpjday@...>, <jesper.juhl@...>, <segher@...>, Herbert Xu <herbert@...>, Paul E. McKenney <paulmck@...>
I'm curious about one minor tangential point. Why, instead of:
b = *(volatile int *)&a;
why can't this just be expressed as:
b = (volatile int)a;
Isn't it the contents of a that's volatile, i.e. it's value can change
invisibly to the compiler, and that's why you want to force a read from
memory? Why do you need the "*(volatile int *)&" construct?
-Bill
-