From: "H. Peter Anvin" <hpa@zytor.com>
To: "Michael K. Edwards" <medwards.linux@gmail.com>
Cc: 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: Thu, 01 Feb 2007 19:15:54 -0800 [thread overview]
Message-ID: <45C2ACEA.8020205@zytor.com> (raw)
In-Reply-To: <f2b55d220702011635s5b338a6ct861645ea7892f732@mail.gmail.com>
Michael K. Edwards wrote:
>
> It looks to me, by comparison to memcpy_(from|to)io, as if the
> volatiles ought to be there. It also looks to me like the void *
> parameters should be u(8|16|32) * instead, so the compiler knows what
> alignment to expect (the implementations would generally fail or suck
> on non-aligned arguments). (That would also be more consistent with
> the fact that the length parameters are in (8|16|32)-bit units, not
> octets.)
>
> Opinions?
>
The real question is whether or not gcc does anything sane with "const
volatile", which may incorrectly sound oxymoronic to some people (it's
not, const means "this element must not be written to" and volatile
means "reading or writing this element has side effects".)
I would argue the right thing to do is to do the patch assuming gcc is
sane, and let it sit in -mm for a kernel cycle or two.
-hpa
next prev parent reply other threads:[~2007-02-02 3:16 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 [this message]
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
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=45C2ACEA.8020205@zytor.com \
--to=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