public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* static immap_t   __iomem *imap    or   immap_t *imap;
@ 2007-03-06 11:08 DI BACCO ANTONIO - technolabs
  2007-03-06 12:44 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: DI BACCO ANTONIO - technolabs @ 2007-03-06 11:08 UTC (permalink / raw)
  To: linuxppc-embedded

Why should I use
static immap_t   __iomem *imap;
And not
immap_t *imap;
in a driver?
when imap =3D ioremap_nocache()

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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: static immap_t   __iomem *imap    or   immap_t *imap;
  2007-03-06 11:08 static immap_t __iomem *imap or immap_t *imap; DI BACCO ANTONIO - technolabs
@ 2007-03-06 12:44 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2007-03-06 12:44 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: DI BACCO ANTONIO - technolabs

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 <><

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-06 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-06 11:08 static immap_t __iomem *imap or immap_t *imap; DI BACCO ANTONIO - technolabs
2007-03-06 12:44 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox