From: Jeff Garzik <jeff@garzik.org>
To: "Michael K. Edwards" <medwards.linux@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: Should io(read|write)(8|16|32)_rep take (const|) volatile u(8|16|32) __iomem *addr?
Date: Fri, 02 Feb 2007 16:40:07 -0500 [thread overview]
Message-ID: <45C3AFB7.80207@garzik.org> (raw)
In-Reply-To: <f2b55d220702021158k7e0ce690xaba95394ee01e4e4@mail.gmail.com>
Michael K. Edwards wrote:
> Doubtless this is on purpose, but it's not clear to me why that should
> be true for these particular functions/macros. I shouldn't have to
> cast away the volatile on a pointer to hardware registers in order to
> pass it into writel(), should I? And it shouldn't be forbidden for
> the caller to declare the pointer volatile so that the compiler
> catches attempts to pass it into non-volatile interfaces, should it?
Therein lies your bug: you should not be annotating your __iomem
pointers with volatile.
That's why volatile is found in the implementation and not the
prototypes of the accessor functions.
Jeff
prev parent reply other threads:[~2007-02-02 21:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <f2b55d220702011624v6cb13c8ct1d70863a661d2227@mail.gmail.com>
2007-02-02 0:35 ` Should io(read|write)(8|16|32)_rep take (const|) volatile u(8|16|32) __iomem *addr? Michael K. Edwards
2007-02-02 3:15 ` H. Peter Anvin
2007-02-02 6:04 ` Jeff Garzik
2007-02-02 6:30 ` H. Peter Anvin
2007-02-02 11:07 ` Jeff Garzik
2007-02-02 19:58 ` Michael K. Edwards
2007-02-02 21:40 ` Jeff Garzik [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=45C3AFB7.80207@garzik.org \
--to=jeff@garzik.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=medwards.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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