Skip to content

Commit 52e0ea9

Browse files
committed
openrisc: io: Define iounmap argument as volatile
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> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Stafford Horne <shorne@gmail.com>
1 parent 3d31616 commit 52e0ea9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/openrisc/include/asm/io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
void __iomem *ioremap(phys_addr_t offset, unsigned long size);
3232

3333
#define iounmap iounmap
34-
extern void iounmap(void __iomem *addr);
34+
extern void iounmap(volatile void __iomem *addr);
3535

3636
#include <asm-generic/io.h>
3737

arch/openrisc/mm/ioremap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void __iomem *__ref ioremap(phys_addr_t addr, unsigned long size)
7777
}
7878
EXPORT_SYMBOL(ioremap);
7979

80-
void iounmap(void __iomem *addr)
80+
void iounmap(volatile void __iomem *addr)
8181
{
8282
/* If the page is from the fixmap pool then we just clear out
8383
* the fixmap mapping.

0 commit comments

Comments
 (0)