From: "David S. Miller" <davem@redhat.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linux Kernel Development <linux-kernel@vger.kernel.org>
Subject: Re: unsigned long ioremap()?
Date: Thu, 3 May 2001 00:08:03 -0700 (PDT) [thread overview]
Message-ID: <15089.979.650927.634060@pizda.ninka.net> (raw)
In-Reply-To: <Pine.LNX.4.05.10105030852330.9438-100000@callisto.of.borg>
In-Reply-To: <Pine.LNX.4.05.10105030852330.9438-100000@callisto.of.borg>
Geert Uytterhoeven writes:
> Since you're not allowed to use direct memory dereferencing on ioremapped
> areas, wouldn't it be more logical to let ioremap() return an unsigned long
> instead of a void *?
>
> Of course we then have to change readb() and friends to take a long as well,
> but at least we'd get compiler warnings when someone tries to do a direct
> dereference.
There is a school of thought which believes that:
struct xdev_regs {
u32 reg1;
u32 reg2;
};
val = readl(®s->reg2);
is cleaner than:
#define REG1 0x00
#define REG2 0x04
val = readl(regs + REG2);
I'm personally ambivalent and believe that both cases should be allowed.
BTW, current {read,write}{b,w,l}() allow both pointer and unsigned
long arguments. If your implementation isn't casting the port address
arg right now, perhaps you haven't tried to compile very many drivers
which use these interfaces or you're just ignoreing the warnings :-)
Later,
David S. Miller
davem@redhat.com
next prev parent reply other threads:[~2001-05-03 7:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-03 6:55 Geert Uytterhoeven
2001-05-03 7:08 ` David S. Miller [this message]
2001-05-03 7:18 ` Jeff Garzik
2001-05-03 7:29 ` C.Praveen
2001-05-03 7:46 ` Jonathan Lundell
2001-05-03 7:57 ` Geert Uytterhoeven
2001-05-03 7:53 ` Abramo Bagnara
2001-05-03 8:08 ` Jeff Garzik
2001-05-03 8:26 ` Geert Uytterhoeven
2001-05-03 8:39 ` Abramo Bagnara
2001-05-03 8:44 ` Jeff Garzik
2001-05-03 8:53 ` Abramo Bagnara
2001-05-03 9:45 ` David Woodhouse
2001-05-03 9:57 ` Abramo Bagnara
2001-05-03 10:02 ` David Woodhouse
2001-05-04 0:22 ` David S. Miller
2001-05-04 7:15 ` Abramo Bagnara
2001-05-04 13:53 ` Jonathan Lundell
2001-05-13 14:00 ` Jes Sorensen
2001-05-13 14:38 ` Abramo Bagnara
2001-05-04 7:30 ` David S. Miller
2001-05-04 11:07 ` Abramo Bagnara
2001-05-03 7:33 ` Jonathan Lundell
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=15089.979.650927.634060@pizda.ninka.net \
--to=davem@redhat.com \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®