* [PATCH 02/17] mips: namespace pollution - mem_... -> __mem_... in io.h
@ 2006-02-08 7:10 Al Viro
2006-02-08 11:01 ` Maciej W. Rozycki
0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2006-02-08 7:10 UTC (permalink / raw)
To: linux-kernel; +Cc: ralf
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_....
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
include/asm-mips/io.h | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
290f10ae4230ef06b71e57673101b7e70c1b29a6
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index a9fa125..6c0aae5 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -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(volatile
const 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(volatile
volatile 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 l
const 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 lo
volatile type *__addr = addr; \
\
while (count--) { \
- *__addr = mem_in##bwlq(port); \
+ *__addr = __mem_in##bwlq(port); \
__addr++; \
} \
}
--
0.99.9.GIT
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 02/17] mips: namespace pollution - mem_... -> __mem_... in io.h
2006-02-08 7:10 [PATCH 02/17] mips: namespace pollution - mem_... -> __mem_... in io.h Al Viro
@ 2006-02-08 11:01 ` Maciej W. Rozycki
2006-02-08 16:14 ` Al Viro
0 siblings, 1 reply; 5+ messages in thread
From: Maciej W. Rozycki @ 2006-02-08 11:01 UTC (permalink / raw)
To: Al Viro; +Cc: linux-kernel, ralf
On Wed, 8 Feb 2006, Al Viro wrote:
> 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_....
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 02/17] mips: namespace pollution - mem_... -> __mem_... in io.h
2006-02-08 11:01 ` Maciej W. Rozycki
@ 2006-02-08 16:14 ` Al Viro
2006-02-08 16:21 ` Maciej W. Rozycki
0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2006-02-08 16:14 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: linux-kernel, ralf
On Wed, Feb 08, 2006 at 11:01:52AM +0000, Maciej W. Rozycki wrote:
> On Wed, 8 Feb 2006, Al Viro wrote:
>
> > 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_....
>
> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 02/17] mips: namespace pollution - mem_... -> __mem_... in io.h
2006-02-08 16:14 ` Al Viro
@ 2006-02-08 16:21 ` Maciej W. Rozycki
2006-02-08 16:33 ` Al Viro
0 siblings, 1 reply; 5+ messages in thread
From: Maciej W. Rozycki @ 2006-02-08 16:21 UTC (permalink / raw)
To: Al Viro; +Cc: linux-kernel, ralf
On Wed, 8 Feb 2006, Al Viro wrote:
> > 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 02/17] mips: namespace pollution - mem_... -> __mem_... in io.h
2006-02-08 16:21 ` Maciej W. Rozycki
@ 2006-02-08 16:33 ` Al Viro
0 siblings, 0 replies; 5+ messages in thread
From: Al Viro @ 2006-02-08 16:33 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: linux-kernel, ralf
On Wed, Feb 08, 2006 at 04:21:45PM +0000, Maciej W. Rozycki wrote:
> On Wed, 8 Feb 2006, Al Viro wrote:
>
> > > 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.
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...
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-02-08 16:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-08 7:10 [PATCH 02/17] mips: namespace pollution - mem_... -> __mem_... in io.h Al Viro
2006-02-08 11:01 ` Maciej W. Rozycki
2006-02-08 16:14 ` Al Viro
2006-02-08 16:21 ` Maciej W. Rozycki
2006-02-08 16:33 ` Al Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox