Commit c3373da9 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by David S. Miller

sparc32: clean up io_32.h

After introducing asm-generic/io.h a few things could still be cleaned up
o Drop useless macro indirection for sbus_* io access methods
  They were in the past used to hide casts between long and pointers
  but this is no longer so
o Fix function definitions for sbus memory functions so
  return value appear on same line as function name
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e1039fb4
...@@ -58,47 +58,38 @@ static inline void _memcpy_toio(volatile void __iomem *dst, const void *src, ...@@ -58,47 +58,38 @@ static inline void _memcpy_toio(volatile void __iomem *dst, const void *src,
* SBus has only one, memory mapped, I/O space. * SBus has only one, memory mapped, I/O space.
* We do not need to flip bytes for SBus of course. * We do not need to flip bytes for SBus of course.
*/ */
static inline u8 _sbus_readb(const volatile void __iomem *addr) static inline u8 sbus_readb(const volatile void __iomem *addr)
{ {
return *(__force volatile u8 *)addr; return *(__force volatile u8 *)addr;
} }
static inline u16 _sbus_readw(const volatile void __iomem *addr) static inline u16 sbus_readw(const volatile void __iomem *addr)
{ {
return *(__force volatile u16 *)addr; return *(__force volatile u16 *)addr;
} }
static inline u32 _sbus_readl(const volatile void __iomem *addr) static inline u32 sbus_readl(const volatile void __iomem *addr)
{ {
return *(__force volatile u32 *)addr; return *(__force volatile u32 *)addr;
} }
static inline void _sbus_writeb(u8 b, volatile void __iomem *addr) static inline void sbus_writeb(u8 b, volatile void __iomem *addr)
{ {
*(__force volatile u8 *)addr = b; *(__force volatile u8 *)addr = b;
} }
static inline void _sbus_writew(u16 w, volatile void __iomem *addr) static inline void sbus_writew(u16 w, volatile void __iomem *addr)
{ {
*(__force volatile u16 *)addr = w; *(__force volatile u16 *)addr = w;
} }
static inline void _sbus_writel(u32 l, volatile void __iomem *addr) static inline void sbus_writel(u32 l, volatile void __iomem *addr)
{ {
*(__force volatile u32 *)addr = l; *(__force volatile u32 *)addr = l;
} }
/* static inline void sbus_memset_io(volatile void __iomem *__dst, int c,
* The only reason for #define's is to hide casts to unsigned long. __kernel_size_t n)
*/
#define sbus_readb(__addr) _sbus_readb(__addr)
#define sbus_readw(__addr) _sbus_readw(__addr)
#define sbus_readl(__addr) _sbus_readl(__addr)
#define sbus_writeb(__b, __addr) _sbus_writeb(__b, __addr)
#define sbus_writew(__w, __addr) _sbus_writew(__w, __addr)
#define sbus_writel(__l, __addr) _sbus_writel(__l, __addr)
static inline void sbus_memset_io(volatile void __iomem *__dst, int c, __kernel_size_t n)
{ {
while(n--) { while(n--) {
sbus_writeb(c, __dst); sbus_writeb(c, __dst);
...@@ -106,10 +97,8 @@ static inline void sbus_memset_io(volatile void __iomem *__dst, int c, __kernel_ ...@@ -106,10 +97,8 @@ static inline void sbus_memset_io(volatile void __iomem *__dst, int c, __kernel_
} }
} }
static inline void sbus_memcpy_fromio(void *dst,
const volatile void __iomem *src,
static inline void
_sbus_memcpy_fromio(void *dst, const volatile void __iomem *src,
__kernel_size_t n) __kernel_size_t n)
{ {
char *d = dst; char *d = dst;
...@@ -121,10 +110,8 @@ _sbus_memcpy_fromio(void *dst, const volatile void __iomem *src, ...@@ -121,10 +110,8 @@ _sbus_memcpy_fromio(void *dst, const volatile void __iomem *src,
} }
} }
#define sbus_memcpy_fromio(d, s, sz) _sbus_memcpy_fromio(d, s, sz) static inline void sbus_memcpy_toio(volatile void __iomem *dst,
const void *src,
static inline void
_sbus_memcpy_toio(volatile void __iomem *dst, const void *src,
__kernel_size_t n) __kernel_size_t n)
{ {
const char *s = src; const char *s = src;
...@@ -137,8 +124,6 @@ _sbus_memcpy_toio(volatile void __iomem *dst, const void *src, ...@@ -137,8 +124,6 @@ _sbus_memcpy_toio(volatile void __iomem *dst, const void *src,
} }
} }
#define sbus_memcpy_toio(d, s, sz) _sbus_memcpy_toio(d, s, sz)
#ifdef __KERNEL__ #ifdef __KERNEL__
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment