[PATCH] m68knommu: fix arg types for outs* functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Greg Ungerer <gerg@xxxxxxxxxxx>

Compiling for any m68knommu targets will give the following warnings:

  CC      lib/iomap_copy.o
lib/iomap.c: In function ‘iowrite8_rep’:
lib/iomap.c:213:2: warning: passing argument 2 of ‘io_outsb’ discards qualifiers from pointer target type
arch/m68k/include/asm/io_no.h:58:20: note: expected ‘void *’ but argument is of type ‘const void *’
lib/iomap.c: In function ‘iowrite16_rep’:
lib/iomap.c:217:2: warning: passing argument 2 of ‘io_outsw’ discards qualifiers from pointer target type
arch/m68k/include/asm/io_no.h:66:20: note: expected ‘void *’ but argument is of type ‘const void *’
lib/iomap.c: In function ‘iowrite32_rep’:
lib/iomap.c:221:2: warning: passing argument 2 of ‘io_outsl’ discards qualifiers from pointer target type
arch/m68k/include/asm/io_no.h:74:20: note: expected ‘void *’ but argument is of type ‘const void *’

Fix it by puting in the appropriate const qualifier on the buf argument of
the m68knommu outs* inline functions.

Signed-off-by: Greg Ungerer <gerg@xxxxxxxxxxx>
---
 arch/m68k/include/asm/io_no.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h
index e153478..52f7e84 100644
--- a/arch/m68k/include/asm/io_no.h
+++ b/arch/m68k/include/asm/io_no.h
@@ -55,7 +55,7 @@ static inline unsigned int _swapl(volatile unsigned long v)
 #define __raw_writew writew
 #define __raw_writel writel
 
-static inline void io_outsb(unsigned int addr, void *buf, int len)
+static inline void io_outsb(unsigned int addr, const void *buf, int len)
 {
 	volatile unsigned char *ap = (volatile unsigned char *) addr;
 	unsigned char *bp = (unsigned char *) buf;
@@ -63,7 +63,7 @@ static inline void io_outsb(unsigned int addr, void *buf, int len)
 		*ap = *bp++;
 }
 
-static inline void io_outsw(unsigned int addr, void *buf, int len)
+static inline void io_outsw(unsigned int addr, const void *buf, int len)
 {
 	volatile unsigned short *ap = (volatile unsigned short *) addr;
 	unsigned short *bp = (unsigned short *) buf;
@@ -71,7 +71,7 @@ static inline void io_outsw(unsigned int addr, void *buf, int len)
 		*ap = _swapw(*bp++);
 }
 
-static inline void io_outsl(unsigned int addr, void *buf, int len)
+static inline void io_outsl(unsigned int addr, const void *buf, int len)
 {
 	volatile unsigned int *ap = (volatile unsigned int *) addr;
 	unsigned int *bp = (unsigned int *) buf;
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux