mips: namespace pollution - mem_... -> __mem_... in io.h
PATCH 2/17 mips: namespace pollution - mem_... -> __mem_... in io.h
Date: 1134015174 -0500
A pile of internal functions use only inside mips io.h has names starting with mem_... and clashing with names in drivers; renamed to __mem_....
---
include/asm-mips/io.h | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-)
290f10ae4230ef06b71e57673101b7e70c1b29a6
include/asm-mips/io.h +16 -16
@@ -56,38 +56,38 @@* variations of functions: non-prefixed ones that preserve the value * and prefixed ones that preserve byte addresses. The latters are * typically used for moving raw data between a peripheral and memory (cf. -* string I/O functions), hence the "mem_" prefix. +* string I/O functions), hence the "__mem_" prefix. */ #if defined(CONFIG_SWAP_IO_SPACE )# define ioswabb (x) (x) -# define mem_ioswabb (x) (x) +# define __mem_ioswabb (x) (x)# ifdef CONFIG_SGI_IP22 /* * IP22 seems braindead enough to swap 16bits values in hardware, but * not 32bits. Go figure... Can't tell without documentation. */ # define ioswabw (x) (x) -# define mem_ioswabw (x) le16_to_cpu(x) +# define __mem_ioswabw (x) le16_to_cpu(x)# else # define ioswabw (x) le16_to_cpu(x) -# define mem_ioswabw (x) (x) +# define __mem_ioswabw (x) (x)# endif # define ioswabl (x) le32_to_cpu(x) -# define mem_ioswabl (x) (x) +# define __mem_ioswabl (x) (x)# define ioswabq (x) le64_to_cpu(x) -# define mem_ioswabq (x) (x) +# define __mem_ioswabq (x) (x)#else # define ioswabb (x) (x) -# define mem_ioswabb (x) (x) +# define __mem_ioswabb (x) (x)# define ioswabw (x) (x) -# define mem_ioswabw (x) cpu_to_le16(x) +# define __mem_ioswabw (x) cpu_to_le16(x)# define ioswabl (x) (x) -# define mem_ioswabl (x) cpu_to_le32(x) +# define __mem_ioswabl (x) cpu_to_le32(x)# define ioswabq (x) (x) -# define mem_ioswabq (x) cpu_to_le32(x) +# define __mem_ioswabq (x) cpu_to_le32(x)#endif
@@ -417,7 +417,7 @@ __BUILD_MEMORY_SINGLE(bus, bwlq, type, 1 \ __BUILD_MEMORY_PFX(__raw_, bwlq, type) \ __BUILD_MEMORY_PFX(, bwlq, type) \ -__BUILD_MEMORY_PFX(mem_, bwlq, type) \ +__BUILD_MEMORY_PFX(__mem_, bwlq, type) \ BUILDIO_MEM(b, u8)BUILDIO_MEM (w, u16)
@@ -430,7 +430,7 @@ BUILDIO_MEM(q, u64)#define BUILDIO_IOPORT (bwlq, type) \ __BUILD_IOPORT_PFX(, bwlq, type) \ - __BUILD_IOPORT_PFX(mem_, bwlq, type) + __BUILD_IOPORT_PFX(__mem_, bwlq, type) BUILDIO_IOPORT(b, u8)BUILDIO_IOPORT (w, u16)
@@ -464,7 +464,7 @@ static inline void writes##bwlq(volatileconst volatile type *__addr = addr; \ \while (count--) { \ - mem_write##bwlq(*__addr, mem); \ + __mem_write##bwlq(*__addr, mem); \ __addr++; \ } \ } \
@@ -475,7 +475,7 @@ static inline void reads##bwlq(volatilevolatile type *__addr = addr; \ \while (count--) { \ - *__addr = mem_read##bwlq(mem); \ + *__addr = __mem_read##bwlq(mem); \ __addr++; \ } \ }
@@ -488,7 +488,7 @@ static inline void outs##bwlq(unsigned lconst volatile type *__addr = addr; \ \while (count--) { \ - mem_out##bwlq(*__addr, port); \ + __mem_out##bwlq(*__addr, port); \ __addr++; \ } \ } \
@@ -499,7 +499,7 @@ static inline void ins##bwlq(unsigned lovolatile type *__addr = addr; \ \while (count--) { \ - *__addr = mem_in##bwlq(port); \ + *__addr = __mem_in##bwlq(port); \ __addr++; \ } \ }
Signature · 1 line
0.99.9.GIT
Quoted 2 lines · Al Viro
A pile of internal functions use only inside mips
io.hhas names starting withmem_... and clashing with names in drivers; renamed to__mem_....
Then the corresponding ones with no "mem_" prefix (these for the PCI I/O
port space) should be prefixed with "__" for consistency as well.
Maciej
Quoted 7 lines · Maciej W. Rozycki
Quoted 2 lines · Al Viro
A pile of internal functions use only inside mips
io.hhas names starting withmem_... and clashing with names in drivers; renamed to__mem_....Then the corresponding ones with no "
mem_" prefix (these for the PCI I/O
port space) should be prefixed with "__" for consistency as well.
Huh???
Things like outb(), etc. *are* public; mem_... ones are not.
Quoted 6 lines · Al Viro
Quoted 2 lines
Then the corresponding ones with no "
mem_" prefix (these for the PCI I/O
port space) should be prefixed with "__" for consistency as well.Huh???
Things like
outb(), etc. *are* public;mem_... ones are not.
I mean if we rename e.g. mem_ioswabb() to __mem_ioswabb(), then we should
rename ioswabb() to __ioswabb() as well. Sorry for not having been clear enough, but I have assumed it is obvious.
Maciej
Quoted 5 lines · Maciej W. Rozycki
Quoted 3 lines · Al Viro
Quoted 2 lines
Then the corresponding ones with no "
mem_" prefix (these for the PCI I/O
port space) should be prefixed with "__" for consistency as well.
Quoted 7 lines
Quoted 3 lines
Huh???
Things like
outb(), etc. *are* public;mem_... ones are not.I mean if we rename e.g.
mem_ioswabb()to__mem_ioswabb(), then we should
renameioswabb()to__ioswabb()as well. Sorry for not having been clear enough, but I have assumed it is obvious.
In principle that would be nice, but... Take a look at those macros. We can do that, but it would mean #define readb __readb, etc. Since really nasty clashes are in mem_inb() et.al. (let's face it, coming up with one of those is far more likely than using ioswabb() for driver-internal purposes) I've stopped at that. Can do a followup switching to __ioswab... and adding defines compensating for changes in visible symbols, but IMO that's a separate patch...