[PATCH 13/26] ARM: pxa: use correct __iomem annotations

Russell King - ARM Linux linux at arm.linux.org.uk
Fri Oct 7 04:51:14 EDT 2011


On Fri, Oct 07, 2011 at 04:11:01PM +0800, Eric Miao wrote:
> To be honest, I'd really like to keep the *_VIRT_BASE definitions to be
> type independent.
> 
> And have the actual register definitions to be casted to void __iomem *
> when being defined, e.g.
> 
> #define APBC_REG(x)	IOMEM(APBC_VIRT_BASE + (x))
> 
> #define APBC_UART1	APBC_REG(0x000)
> 
> Arnd, do we have some standard guidelines on this for all SoCs
> to follow? As I know, it's currently still being a mess.

It makes much more sense for the base address to be correctly typed (even
though it does mean a cast in the map_desc tables).  It avoids type
problems if someone does readl(APBC_VIRT_BASE + reg) somewhere, and
also avoids type problems should someone decide to pass the base address
around.



More information about the linux-arm-kernel mailing list