Skip to contentSkip to conversation

ARM: s3c24xx: avoid warning for inb/outb

PATCH Applied Arnd Bergmann 2 participants 2 messages Feb 25, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: s3c24xx: avoid warning for inb/outb

s3c24xx implements its own inb/outb macros, but the implementation prints warnings when the port number argument is not a 32-bit scalar:

drivers/scsi/pas16.c: In function 'NCR5380_pwrite':
arch/arm/mach-s3c24xx/include/mach/io.h:193:68: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define __ioaddrc(port) ((__PORT_PCIO(port) ? PCIO_BASE + (port) : (void __iomem *)(port)))

This slightly modifies the definition of the __ioaddrc macro to avoid the warning.

---
 arch/arm/mach-s3c24xx/include/mach/io.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-s3c24xx/include/mach/io.h +1 -1
index 5dd1db4e2677..235c53647aa4 100644
@@ -190,7 +190,7 @@ DECLARE_IO(int,l,"")
 	result;								\
 })
 
-#define __ioaddrc(port)	((__PORT_PCIO(port) ? PCIO_BASE + (port) : (void __iomem *)(port)))
+#define __ioaddrc(port)	((__PORT_PCIO(port) ? PCIO_BASE + (port) : (void __iomem *)0 + (port)))
 
 #define inb(p)		(__builtin_constant_p((p)) ? __inbc(p)	   : __inb(p))
 #define inw(p)		(__builtin_constant_p((p)) ? __inwc(p)	   : __inw(p))
Signature · 1 line
2.7.0
#1 lore raw
Quoted 7 lines · Arnd Bergmann

s3c24xx implements its own inb/outb macros, but the implementation prints warnings when the port number argument is not a 32-bit scalar:

drivers/scsi/pas16.c: In function 'NCR5380_pwrite':
arch/arm/mach-s3c24xx/include/mach/io.h:193:68: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define __ioaddrc(port) ((__PORT_PCIO(port) ? PCIO_BASE + (port) : (void __iomem *)(port)))

Quoted 8 lines

This slightly modifies the definition of the __ioaddrc macro to avoid the warning.

---
 arch/arm/mach-s3c24xx/include/mach/io.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, applied.

Krzysztof