[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0611042013400.25218@g5.osdl.org>
Date: Sat, 4 Nov 2006 20:16:59 -0800 (PST)
From: Linus Torvalds <torvalds@...l.org>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>
cc: Russell King <rmk+lkml@....linux.org.uk>,
Linux Kernel list <linux-kernel@...r.kernel.org>,
Jeff Garzik <jgarzik@...ox.com>, Andrew Morton <akpm@...l.org>,
"David S. Miller" <davem@...emloft.net>,
Paul Mackerras <paulus@...ba.org>
Subject: Re: lib/iomap.c mmio_{in,out}s* vs. __raw_* accessors
On Sun, 5 Nov 2006, Benjamin Herrenschmidt wrote:
> >
> > Just rip the _be versions out, methinks.
>
> At least one user:
>
> ./drivers/scsi/53c700.h: __u32 value = bEBus ? ioread32be(hostdata->base + reg) :
> ./drivers/scsi/53c700.h: bEBus ? iowrite32be(value, hostdata->base + reg):
>
> Should I make it use explicit swab32 instead ?
Well, I actually really dislike your version with the explicit swab.
The _only_ reason to use "ioread32be()" would be because the machine is
actually natively BE, and you want to avoid swab. That's kind of the point
of using "be32_to_cpu(__raw_readl(addr)))" like we do now - it will do the
byte swap only if it's necessary.
In contrast, your "swab(readl())" does _two_ byteswaps - once to turn it
into LE, then to turn it back into BE.
So if we can't just rip it out, then we sure as hell shouldn't replace it
with something that is obviously worse either.
In other words - I don't see the reasoning here again. You seem to want to
make the code just worse.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists