All of lore.kernel.org
 help / color / mirror / Atom feed
* parisc: fix io accessors for generic byteorder.h
@ 2008-12-08  4:43 Kyle McMartin
  2008-12-08  4:55 ` Harvey Harrison
  0 siblings, 1 reply; 4+ messages in thread
From: Kyle McMartin @ 2008-12-08  4:43 UTC (permalink / raw)
  To: linux-parisc; +Cc: Harvey Harrison

These were using __fswabX which is marooned in <linux/byteorder/swab.h>
instead we'll just use the __arch_swabX defines from <asm/byteorder.h>

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
---
 arch/parisc/include/asm/io.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/parisc/include/asm/io.h b/arch/parisc/include/asm/io.h
index 55ddb18..6943135 100644
--- a/arch/parisc/include/asm/io.h
+++ b/arch/parisc/include/asm/io.h
@@ -2,6 +2,7 @@
 #define _ASM_IO_H
 
 #include <linux/types.h>
+#include <asm/byteorder.h>
 #include <asm/pgtable.h>
 
 extern unsigned long parisc_vmerge_boundary;
@@ -180,11 +181,10 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add
 	*(volatile unsigned long long __force *) addr = b;
 }
 
-/* readb can never be const, so use __fswab instead of le*_to_cpu */
 #define readb(addr) __raw_readb(addr)
-#define readw(addr) __fswab16(__raw_readw(addr))
-#define readl(addr) __fswab32(__raw_readl(addr))
-#define readq(addr) __fswab64(__raw_readq(addr))
+#define readw(addr) __arch_swab16(__raw_readw(addr))
+#define readl(addr) __arch_swab32(__raw_readl(addr))
+#define readq(addr) __arch_swab64(__raw_readq(addr))
 #define writeb(b, addr) __raw_writeb(b, addr)
 #define writew(b, addr) __raw_writew(cpu_to_le16(b), addr)
 #define writel(b, addr) __raw_writel(cpu_to_le32(b), addr)
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: parisc: fix io accessors for generic byteorder.h
  2008-12-08  4:43 parisc: fix io accessors for generic byteorder.h Kyle McMartin
@ 2008-12-08  4:55 ` Harvey Harrison
  2008-12-08  4:58   ` Kyle McMartin
  0 siblings, 1 reply; 4+ messages in thread
From: Harvey Harrison @ 2008-12-08  4:55 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: linux-parisc

On Sun, 2008-12-07 at 23:43 -0500, Kyle McMartin wrote:
> These were using __fswabX which is marooned in <linux/byteorder/swab.h>
> instead we'll just use the __arch_swabX defines from <asm/byteorder.h>
> 

Sorry I missed this usage :-/

Any reason not to just use __swab16 __swab32 __swab64?  I'd like to keep
the __arch helpers confined to swab.h only.

Cheers,

Harvey


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: parisc: fix io accessors for generic byteorder.h
  2008-12-08  4:55 ` Harvey Harrison
@ 2008-12-08  4:58   ` Kyle McMartin
  2008-12-08  6:09     ` Harvey Harrison
  0 siblings, 1 reply; 4+ messages in thread
From: Kyle McMartin @ 2008-12-08  4:58 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Kyle McMartin, linux-parisc

On Sun, Dec 07, 2008 at 08:55:59PM -0800, Harvey Harrison wrote:
> On Sun, 2008-12-07 at 23:43 -0500, Kyle McMartin wrote:
> > These were using __fswabX which is marooned in <linux/byteorder/swab.h>
> > instead we'll just use the __arch_swabX defines from <asm/byteorder.h>
> > 
> 
> Sorry I missed this usage :-/
> 
> Any reason not to just use __swab16 __swab32 __swab64?  I'd like to keep
> the __arch helpers confined to swab.h only.
> 

Not particularly, I believe the idea of using fswabX was to Make Damned
Sure(tm) that gcc wouldn't eliminate the expression by being too smart
for its own good. It's probably fine now, though I have half a mind to
just fold it in.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: parisc: fix io accessors for generic byteorder.h
  2008-12-08  4:58   ` Kyle McMartin
@ 2008-12-08  6:09     ` Harvey Harrison
  0 siblings, 0 replies; 4+ messages in thread
From: Harvey Harrison @ 2008-12-08  6:09 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: Kyle McMartin, linux-parisc

On Sun, 2008-12-07 at 23:58 -0500, Kyle McMartin wrote:
> On Sun, Dec 07, 2008 at 08:55:59PM -0800, Harvey Harrison wrote:
> > On Sun, 2008-12-07 at 23:43 -0500, Kyle McMartin wrote:
> > > These were using __fswabX which is marooned in <linux/byteorder/swab.h>
> > > instead we'll just use the __arch_swabX defines from <asm/byteorder.h>
> > > 
> > 
> > Sorry I missed this usage :-/
> > 
> > Any reason not to just use __swab16 __swab32 __swab64?  I'd like to keep
> > the __arch helpers confined to swab.h only.
> > 
> 
> Not particularly, I believe the idea of using fswabX was to Make Damned
> Sure(tm) that gcc wouldn't eliminate the expression by being too smart
> for its own good. It's probably fine now, though I have half a mind to
> just fold it in.

By fold it in, I take it to mean, write them as static inlines rather
than macros, if so, I definitely approve.

Harvey


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-08  6:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-08  4:43 parisc: fix io accessors for generic byteorder.h Kyle McMartin
2008-12-08  4:55 ` Harvey Harrison
2008-12-08  4:58   ` Kyle McMartin
2008-12-08  6:09     ` Harvey Harrison

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.