diff mbox series

[4/6] ARM: omap: fix address space warnings from sparse

Message ID 20220428133210.990808-5-arnd@kernel.org
State New
Headers show
Series ARM: omap/davinci/spear fixes for multiplatform | expand

Commit Message

Arnd Bergmann April 28, 2022, 1:31 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

Moving sram code from plat-omap got the attention of the kernel test robot.

I found a few more places with related warnings because the sram
references are a mix of kernel pointers and __iomem pointers:

mach-omap1/sram-init.c:56:17: warning: cast removes address space '__iomem' of expression
mach-omap1/board-ams-delta.c:667:9: warning: incorrect type in argument 1 (different base types)
mach-omap2/sram.c:78:17: warning: cast removes address space '__iomem' of expression
mach-omap2/omap4-common.c:142:27: warning: incorrect type in assignment (different address spaces)
mach-omap2/omap4-common.c:142:27:    expected void [noderef] __iomem *static [toplevel] sram_sync
mach-omap2/omap4-common.c:142:27:    got void *
mach-omap2/pm34xx.c:113:45: warning: incorrect type in argument 1 (different address spaces)
mach-omap2/pm34xx.c:113:45:    expected void [noderef] __iomem *save_regs
mach-omap2/pm34xx.c:113:45:    got void *extern [addressable] [toplevel] omap3_secure_ram_storage

There is no good solution here, as sram is a bit special in this
regard. Change the annotations to at least shut up the warnings.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-omap1/board-ams-delta.c | 2 +-
 arch/arm/mach-omap1/sram-init.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Tony Lindgren April 29, 2022, 5:27 a.m. UTC | #1
* Arnd Bergmann <arnd@kernel.org> [220428 13:32]:
> mach-omap2/sram.c:78:17: warning: cast removes address space '__iomem' of expression
> mach-omap2/omap4-common.c:142:27: warning: incorrect type in assignment (different address spaces)
> mach-omap2/omap4-common.c:142:27:    expected void [noderef] __iomem *static [toplevel] sram_sync
> mach-omap2/omap4-common.c:142:27:    got void *
> mach-omap2/pm34xx.c:113:45: warning: incorrect type in argument 1 (different address spaces)
> mach-omap2/pm34xx.c:113:45:    expected void [noderef] __iomem *save_regs
> mach-omap2/pm34xx.c:113:45:    got void *extern [addressable] [toplevel] omap3_secure_ram_storage

These omap2 specific warnings seem to have been split out into a separate
patch, or maybe a patch hunk is missing here?

>  arch/arm/mach-omap1/board-ams-delta.c | 2 +-
>  arch/arm/mach-omap1/sram-init.c       | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

As this touches only omap1 files. If this patch will be omap1 specific,
maybe update the subject line too?

Regards,

Tony
diff mbox series

Patch

diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index cd97df48686e..651c28d81132 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -664,7 +664,7 @@  static void __init ams_delta_latch2_init(void)
 {
 	u16 latch2 = 1 << LATCH2_PIN_MODEM_NRESET | 1 << LATCH2_PIN_MODEM_CODEC;
 
-	__raw_writew(latch2, LATCH2_VIRT);
+	__raw_writew(latch2, IOMEM(LATCH2_VIRT));
 }
 
 static void __init ams_delta_init(void)
diff --git a/arch/arm/mach-omap1/sram-init.c b/arch/arm/mach-omap1/sram-init.c
index 0e3ec32a008e..27c42e2a21cc 100644
--- a/arch/arm/mach-omap1/sram-init.c
+++ b/arch/arm/mach-omap1/sram-init.c
@@ -53,7 +53,7 @@  static void *omap_sram_push_address(unsigned long size)
 	new_ceil = ROUND_DOWN(new_ceil, FNCPY_ALIGN);
 	omap_sram_ceil = IOMEM(new_ceil);
 
-	return (void *)omap_sram_ceil;
+	return (void __force *)omap_sram_ceil;
 }
 
 void *omap_sram_push(void *funcp, unsigned long size)