ARM: omap: fix address space warnings from sparse
authorArnd Bergmann <arnd@arndb.de>
Thu, 28 Apr 2022 09:08:16 +0000 (11:08 +0200)
committerArnd Bergmann <arnd@arndb.de>
Fri, 29 Apr 2022 07:53:28 +0000 (09:53 +0200)
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
arch/arm/mach-omap1/sram-init.c
arch/arm/mach-omap2/omap-secure.c
arch/arm/mach-omap2/omap-secure.h
arch/arm/mach-omap2/omap4-common.c
arch/arm/mach-omap2/sram.c

index cd97df48686e3e41dc0fea29ac1770b406e3ede1..651c28d81132199ee63623cc44ece984ceabb4d6 100644 (file)
@@ -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)
index 0e3ec32a008e221ce139d3fa7858093860253716..27c42e2a21cc1b52ea23864f7113875dbcbb91c5 100644 (file)
@@ -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)
index 11677fc2968f27093c6f535534e9db288f04393a..fb9c114b9dd7e0498eff79538d779c9f3dc006f0 100644 (file)
@@ -124,7 +124,7 @@ phys_addr_t omap_secure_ram_mempool_base(void)
 }
 
 #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
-u32 omap3_save_secure_ram(void __iomem *addr, int size)
+u32 omap3_save_secure_ram(void *addr, int size)
 {
        static u32 param[5];
        u32 ret;
index 172069f3161642f7a27a4290d19ccc4e4ebb6b2a..9e67d4efdd0c676afbbd26e94de2414d73b09bb0 100644 (file)
@@ -73,7 +73,7 @@ extern u32 omap_smc3(u32 id, u32 process, u32 flag, u32 pargs);
 extern phys_addr_t omap_secure_ram_mempool_base(void);
 extern int omap_secure_ram_reserve_memblock(void);
 extern u32 save_secure_ram_context(u32 args_pa);
-extern u32 omap3_save_secure_ram(void __iomem *save_regs, int size);
+extern u32 omap3_save_secure_ram(void *save_regs, int size);
 
 extern u32 rx51_secure_dispatcher(u32 idx, u32 process, u32 flag, u32 nargs,
                                  u32 arg1, u32 arg2, u32 arg3, u32 arg4);
index 5c3845730dbf547d8c34040d069bab4b51006be5..3530b77dd2f07ef14f41cba9ecdac01e54bce796 100644 (file)
@@ -139,7 +139,7 @@ static int __init omap4_sram_init(void)
                pr_warn("%s:Unable to get sram pool needed to handle errata I688\n",
                        __func__);
        else
-               sram_sync = (void *)gen_pool_alloc(sram_pool, PAGE_SIZE);
+               sram_sync = (void __iomem *)gen_pool_alloc(sram_pool, PAGE_SIZE);
 
        return 0;
 }
index c685afb8bd035d5acf579b61b75de4c43e5e1b20..39cf270da718a753210b65f4864c1e12164dc8ef 100644 (file)
@@ -75,7 +75,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)