diff options
author | Corey Minyard <cminyard@mvista.com> | 2012-12-18 17:21:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-18 18:02:11 -0500 |
commit | c24bf9b4cc6a0f330ea355d73bfdf1dae7e63a05 (patch) | |
tree | f1865e5b9c399ae001131d2fdadf7b0b4ddfb686 /arch/cris/include | |
parent | 9f67675a249f6f993edd41bc084827411366a652 (diff) |
CRIS: fix I/O macros
The inb/outb macros for CRIS are broken from a number of points of view,
missing () around parameters and they have an unprotected if statement
in them. This was breaking the compile of IPMI on CRIS and thus I was
being annoyed by build regressions, so I fixed them.
Plus I don't think they would have worked at all, since the data values
were missing "&" and the outsl had a "3" instead of a "4" for the size.
From what I can tell, this stuff is not used at all, so this can't be
any more broken than it was before, anyway.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <starvik@axis.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/cris/include')
-rw-r--r-- | arch/cris/include/asm/io.h | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/arch/cris/include/asm/io.h b/arch/cris/include/asm/io.h index 32567bc2a421..ac12ae2b9286 100644 --- a/arch/cris/include/asm/io.h +++ b/arch/cris/include/asm/io.h | |||
@@ -133,12 +133,39 @@ static inline void writel(unsigned int b, volatile void __iomem *addr) | |||
133 | #define insb(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,1,count) : 0) | 133 | #define insb(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,1,count) : 0) |
134 | #define insw(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,2,count) : 0) | 134 | #define insw(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,2,count) : 0) |
135 | #define insl(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,4,count) : 0) | 135 | #define insl(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,4,count) : 0) |
136 | #define outb(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,1,1) | 136 | static inline void outb(unsigned char data, unsigned int port) |
137 | #define outw(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,2,1) | 137 | { |
138 | #define outl(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,4,1) | 138 | if (cris_iops) |
139 | #define outsb(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,1,count) | 139 | cris_iops->write_io(port, (void *) &data, 1, 1); |
140 | #define outsw(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,2,count) | 140 | } |
141 | #define outsl(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,3,count) | 141 | static inline void outw(unsigned short data, unsigned int port) |
142 | { | ||
143 | if (cris_iops) | ||
144 | cris_iops->write_io(port, (void *) &data, 2, 1); | ||
145 | } | ||
146 | static inline void outl(unsigned int data, unsigned int port) | ||
147 | { | ||
148 | if (cris_iops) | ||
149 | cris_iops->write_io(port, (void *) &data, 4, 1); | ||
150 | } | ||
151 | static inline void outsb(unsigned int port, const void *addr, | ||
152 | unsigned long count) | ||
153 | { | ||
154 | if (cris_iops) | ||
155 | cris_iops->write_io(port, (void *)addr, 1, count); | ||
156 | } | ||
157 | static inline void outsw(unsigned int port, const void *addr, | ||
158 | unsigned long count) | ||
159 | { | ||
160 | if (cris_iops) | ||
161 | cris_iops->write_io(port, (void *)addr, 2, count); | ||
162 | } | ||
163 | static inline void outsl(unsigned int port, const void *addr, | ||
164 | unsigned long count) | ||
165 | { | ||
166 | if (cris_iops) | ||
167 | cris_iops->write_io(port, (void *)addr, 4, count); | ||
168 | } | ||
142 | 169 | ||
143 | /* | 170 | /* |
144 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | 171 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem |