From: Arnd Bergmann <arnd@arndb•de>
To: linuxppc-embedded@ozlabs•org
Cc: DI BACCO ANTONIO - technolabs <Antonio.DiBacco@technolabs•it>
Subject: Re: static immap_t __iomem *imap or immap_t *imap;
Date: Tue, 6 Mar 2007 13:44:00 +0100 [thread overview]
Message-ID: <200703061344.00685.arnd@arndb.de> (raw)
In-Reply-To: <F1F6EC0C8B75034F9E3A79FC85122E8E6C0AA8@aquib01a>
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 <><
prev parent reply other threads:[~2007-03-06 12:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200703061344.00685.arnd@arndb.de \
--to=arnd@arndb$(echo .)de \
--cc=Antonio.DiBacco@technolabs$(echo .)it \
--cc=linuxppc-embedded@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox