Subject: Re: static immap_t __iomem *imap or immap_t *imap;

From: Arnd Bergmann <[email-masked]>
Date: Tue, 6 Mar 2007 13:44:00 +0100

On Tuesday 06 March 2007, DI BACCO ANTONIO - technolabs wrote:
> Why should I use
> static immap_t =A0 __iomem *imap;
> And not
> immap_t *imap;
> in a driver?
> when imap =3D ioremap_nocache()
>=20
> In particular I know that __iomem is useful to the compiler to avoid
> reordering and delaying io memory writes but what's the need for static
> in this case?

The '__iomem' is use to allow static checking with the 'sparse' tool,
you really should use that before submitting any code. At this point,
gcc itself doesn't care. ioremap_nocache() returns __iomem, so anything
you assign it to should also be __iomem.

The 'static' is what you should use for _any_ symbol that is private
to your driver in order to avoid namespace pollution, it has nothing
to do whatsoever with whether it is about an __iomem address or not.

	Arnd <><