linux-openrisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] openrisc: io: Define iounmap argument as volatile
@ 2022-07-29 11:07 Stafford Horne
  2022-07-29 15:23 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Stafford Horne @ 2022-07-29 11:07 UTC (permalink / raw)
  To: LKML; +Cc: Jonas Bonn, openrisc, Guenter Roeck

When OpenRISC enables PCI it allows for more drivers to be compiled
resulting in exposing the following with -Werror.

    drivers/video/fbdev/riva/fbdev.c: In function 'rivafb_probe':
    drivers/video/fbdev/riva/fbdev.c:2062:42: error:
	    passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type

    drivers/video/fbdev/nvidia/nvidia.c: In function 'nvidiafb_probe':
    drivers/video/fbdev/nvidia/nvidia.c:1414:20: error:
	    passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type

    drivers/scsi/aic7xxx/aic7xxx_osm.c: In function 'ahc_platform_free':
    drivers/scsi/aic7xxx/aic7xxx_osm.c:1231:41: error:
	    passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type

Most architectures define the iounmap argument to be volatile.  To fix this
issue we do the same for OpenRISC.  This patch must go before PCI is enabled on
OpenRISC to avoid any compile failures.

Link: https://lore.kernel.org/lkml/20220729033728.GA2195022@roeck-us.net/
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Stafford Horne <shorne@gmail.com>
---
 arch/openrisc/include/asm/io.h | 2 +-
 arch/openrisc/mm/ioremap.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/openrisc/include/asm/io.h b/arch/openrisc/include/asm/io.h
index 625ac6ad1205..ee6043a03173 100644
--- a/arch/openrisc/include/asm/io.h
+++ b/arch/openrisc/include/asm/io.h
@@ -31,7 +31,7 @@
 void __iomem *ioremap(phys_addr_t offset, unsigned long size);
 
 #define iounmap iounmap
-extern void iounmap(void __iomem *addr);
+extern void iounmap(volatile void __iomem *addr);
 
 #include <asm-generic/io.h>
 
diff --git a/arch/openrisc/mm/ioremap.c b/arch/openrisc/mm/ioremap.c
index daae13a76743..8ec0dafecf25 100644
--- a/arch/openrisc/mm/ioremap.c
+++ b/arch/openrisc/mm/ioremap.c
@@ -77,7 +77,7 @@ void __iomem *__ref ioremap(phys_addr_t addr, unsigned long size)
 }
 EXPORT_SYMBOL(ioremap);
 
-void iounmap(void __iomem *addr)
+void iounmap(volatile void __iomem *addr)
 {
 	/* If the page is from the fixmap pool then we just clear out
 	 * the fixmap mapping.
-- 
2.37.1


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

* Re: [PATCH] openrisc: io: Define iounmap argument as volatile
  2022-07-29 11:07 [PATCH] openrisc: io: Define iounmap argument as volatile Stafford Horne
@ 2022-07-29 15:23 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2022-07-29 15:23 UTC (permalink / raw)
  To: Stafford Horne; +Cc: Jonas Bonn, openrisc, LKML

On Fri, Jul 29, 2022 at 08:07:25PM +0900, Stafford Horne wrote:
> When OpenRISC enables PCI it allows for more drivers to be compiled
> resulting in exposing the following with -Werror.
> 
>     drivers/video/fbdev/riva/fbdev.c: In function 'rivafb_probe':
>     drivers/video/fbdev/riva/fbdev.c:2062:42: error:
> 	    passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type
> 
>     drivers/video/fbdev/nvidia/nvidia.c: In function 'nvidiafb_probe':
>     drivers/video/fbdev/nvidia/nvidia.c:1414:20: error:
> 	    passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type
> 
>     drivers/scsi/aic7xxx/aic7xxx_osm.c: In function 'ahc_platform_free':
>     drivers/scsi/aic7xxx/aic7xxx_osm.c:1231:41: error:
> 	    passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type
> 
> Most architectures define the iounmap argument to be volatile.  To fix this
> issue we do the same for OpenRISC.  This patch must go before PCI is enabled on
> OpenRISC to avoid any compile failures.
> 
> Link: https://lore.kernel.org/lkml/20220729033728.GA2195022@roeck-us.net/
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Stafford Horne <shorne@gmail.com>

Tested-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  arch/openrisc/include/asm/io.h | 2 +-
>  arch/openrisc/mm/ioremap.c     | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/openrisc/include/asm/io.h b/arch/openrisc/include/asm/io.h
> index 625ac6ad1205..ee6043a03173 100644
> --- a/arch/openrisc/include/asm/io.h
> +++ b/arch/openrisc/include/asm/io.h
> @@ -31,7 +31,7 @@
>  void __iomem *ioremap(phys_addr_t offset, unsigned long size);
>  
>  #define iounmap iounmap
> -extern void iounmap(void __iomem *addr);
> +extern void iounmap(volatile void __iomem *addr);
>  
>  #include <asm-generic/io.h>
>  
> diff --git a/arch/openrisc/mm/ioremap.c b/arch/openrisc/mm/ioremap.c
> index daae13a76743..8ec0dafecf25 100644
> --- a/arch/openrisc/mm/ioremap.c
> +++ b/arch/openrisc/mm/ioremap.c
> @@ -77,7 +77,7 @@ void __iomem *__ref ioremap(phys_addr_t addr, unsigned long size)
>  }
>  EXPORT_SYMBOL(ioremap);
>  
> -void iounmap(void __iomem *addr)
> +void iounmap(volatile void __iomem *addr)
>  {
>  	/* If the page is from the fixmap pool then we just clear out
>  	 * the fixmap mapping.
> -- 
> 2.37.1
> 

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

end of thread, other threads:[~2022-07-29 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-29 11:07 [PATCH] openrisc: io: Define iounmap argument as volatile Stafford Horne
2022-07-29 15:23 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).