Skip to contentSkip to conversation

arc: iounmap() arg is volatile

PATCH In review Randy Dunlap 2 participants 2 messages Oct 10, 2022 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arc: iounmap() arg is volatile

Add 'volatile' to iounmap()'s argument to prevent build warnings. This make it the same as other major architectures.

Placates these warnings: (12 such warnings)

../drivers/video/fbdev/riva/fbdev.c: In function 'rivafb_probe':
../drivers/video/fbdev/riva/fbdev.c:2067:42: error: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Werror=discarded-qualifiers]
2067 | iounmap(default_par->riva.PRAMIN);

Fixes 1162b0701b14b ("ARC: I/O and DMA Mappings")
Cc Vineet Gupta <[email protected]>
Cc Arnd Bergmann <[email protected]>

---
v2: add Arnd to Cc: list

 arch/arc/include/asm/io.h |    2 +-
 arch/arc/mm/ioremap.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arc/include/asm/io.h +1 -1
@@ -32,7 +32,7 @@ static inline void ioport_unmap(void __i
 {
 }
 
-extern void iounmap(const void __iomem *addr);
+extern void iounmap(const volatile void __iomem *addr);
 
 /*
  * io{read,write}{16,32}be() macros
arch/arc/mm/ioremap.c +1 -1
@@ -94,7 +94,7 @@ void __iomem *ioremap_prot(phys_addr_t p
 EXPORT_SYMBOL(ioremap_prot);
 
 
-void iounmap(const void __iomem *addr)
+void iounmap(const volatile void __iomem *addr)
 {
 	/* weird double cast to handle phys_addr_t > 32 bits */
 	if (arc_uncached_addr_space((phys_addr_t)(u32)addr))

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

maintainer
#1 lore raw
Quoted 9 lines · Randy Dunlap

Add 'volatile' to iounmap()'s argument to prevent build warnings. This make it the same as other major architectures.

Placates these warnings: (12 such warnings)

../drivers/video/fbdev/riva/fbdev.c: In function 'rivafb_probe':
../drivers/video/fbdev/riva/fbdev.c:2067:42: error: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Werror=discarded-qualifiers]
2067 | iounmap(default_par->riva.PRAMIN);

Quoted 5 lines
Fixes 1162b0701b14b ("ARC: I/O and DMA Mappings")
Cc Vineet Gupta<[email protected]>
Cc Arnd Bergmann<[email protected]>

Thx for the fix. On for-curr.

-Vineet