All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARC: align iounmap() argument with other architectures
@ 2022-08-11  2:55 ` Randy Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2022-08-11  2:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Vineet Gupta, linux-snps-arc

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

Example (one of many):
drivers/scsi/aacraid/nark.c: In function 'aac_nark_ioremap':
drivers/scsi/aacraid/nark.c:36:28: error: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Werror=discarded-qualifiers]
   36 |                 iounmap(dev->base);
In file included from ../include/linux/io.h:13,
                 from ../include/linux/irq.h:20,
                 from ../include/asm-generic/hardirq.h:17,
                 from ./arch/arc/include/generated/asm/hardirq.h:1,
                 from ../include/linux/hardirq.h:11,
                 from ../include/linux/interrupt.h:11,
                 from ../include/linux/pci.h:38,
                 from ../drivers/scsi/aacraid/nark.c:18:
arch/arc/include/asm/io.h:35:41: note: expected 'const void *' but argument is of type 'volatile void *'
   35 | extern void iounmap(const void __iomem *addr);

Fixes: 1162b0701b14 ("ARC: I/O and DMA Mappings")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: linux-snps-arc@lists.infradead.org
---
 arch/arc/include/asm/io.h |    2 +-
 arch/arc/mm/ioremap.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/arch/arc/include/asm/io.h
+++ b/arch/arc/include/asm/io.h
@@ -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
--- a/arch/arc/mm/ioremap.c
+++ b/arch/arc/mm/ioremap.c
@@ -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))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] ARC: align iounmap() argument with other architectures
@ 2022-08-11  2:55 ` Randy Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2022-08-11  2:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Vineet Gupta, linux-snps-arc

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

Example (one of many):
drivers/scsi/aacraid/nark.c: In function 'aac_nark_ioremap':
drivers/scsi/aacraid/nark.c:36:28: error: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Werror=discarded-qualifiers]
   36 |                 iounmap(dev->base);
In file included from ../include/linux/io.h:13,
                 from ../include/linux/irq.h:20,
                 from ../include/asm-generic/hardirq.h:17,
                 from ./arch/arc/include/generated/asm/hardirq.h:1,
                 from ../include/linux/hardirq.h:11,
                 from ../include/linux/interrupt.h:11,
                 from ../include/linux/pci.h:38,
                 from ../drivers/scsi/aacraid/nark.c:18:
arch/arc/include/asm/io.h:35:41: note: expected 'const void *' but argument is of type 'volatile void *'
   35 | extern void iounmap(const void __iomem *addr);

Fixes: 1162b0701b14 ("ARC: I/O and DMA Mappings")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: linux-snps-arc@lists.infradead.org
---
 arch/arc/include/asm/io.h |    2 +-
 arch/arc/mm/ioremap.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/arch/arc/include/asm/io.h
+++ b/arch/arc/include/asm/io.h
@@ -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
--- a/arch/arc/mm/ioremap.c
+++ b/arch/arc/mm/ioremap.c
@@ -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
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-11  2:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11  2:55 [PATCH] ARC: align iounmap() argument with other architectures Randy Dunlap
2022-08-11  2:55 ` Randy Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.