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: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Sam Ravnborg 2014-04-26 09:57:37 +02:00 коммит произвёл David S. Miller
Родитель e1039fb426
Коммит c3373da90b
1 изменённых файлов: 14 добавлений и 29 удалений

Просмотреть файл

@ -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.
* 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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
/*
* The only reason for #define's is to hide casts to unsigned long.
*/
#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)
static inline void sbus_memset_io(volatile void __iomem *__dst, int c,
__kernel_size_t n)
{
while(n--) {
sbus_writeb(c, __dst);
@ -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)
{
char *d = dst;
@ -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)
{
const char *s = 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__
/*