On Tuesday 23 September 2014 17:18:43 Jingchang Lu wrote:
I will reconsider this setting. BTW, why writel() can't be used
for memory location since it's still mapped and registers space is
also memory mapped? Thanks.
You cannot rely on an '__iomem' token to actually be a pointer, even
if that is currently the case on ARM.
On other architectures, the bits in the pointer can encode something
completely different, e.g. it may be the physical address on
architectures that have instructions to load/store on that directly,
and ioremap() in that case returns an identity mapping.
If you install sparse and build with 'make C=1', you will in fact
get a warning about the code when you assign a regular pointer to
an __iomem pointer or vice versa.
Arnd