Skip to content

Commit deb4471

Browse files
committed
ARM: omap: fix address space warnings from sparse
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 <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent c164620 commit deb4471

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

arch/arm/mach-omap1/board-ams-delta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ static void __init ams_delta_latch2_init(void)
664664
{
665665
u16 latch2 = 1 << LATCH2_PIN_MODEM_NRESET | 1 << LATCH2_PIN_MODEM_CODEC;
666666

667-
__raw_writew(latch2, LATCH2_VIRT);
667+
__raw_writew(latch2, IOMEM(LATCH2_VIRT));
668668
}
669669

670670
static void __init ams_delta_init(void)

arch/arm/mach-omap1/sram-init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static void *omap_sram_push_address(unsigned long size)
5353
new_ceil = ROUND_DOWN(new_ceil, FNCPY_ALIGN);
5454
omap_sram_ceil = IOMEM(new_ceil);
5555

56-
return (void *)omap_sram_ceil;
56+
return (void __force *)omap_sram_ceil;
5757
}
5858

5959
void *omap_sram_push(void *funcp, unsigned long size)

arch/arm/mach-omap2/omap-secure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ phys_addr_t omap_secure_ram_mempool_base(void)
124124
}
125125

126126
#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
127-
u32 omap3_save_secure_ram(void __iomem *addr, int size)
127+
u32 omap3_save_secure_ram(void *addr, int size)
128128
{
129129
static u32 param[5];
130130
u32 ret;

arch/arm/mach-omap2/omap-secure.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ extern u32 omap_smc3(u32 id, u32 process, u32 flag, u32 pargs);
7373
extern phys_addr_t omap_secure_ram_mempool_base(void);
7474
extern int omap_secure_ram_reserve_memblock(void);
7575
extern u32 save_secure_ram_context(u32 args_pa);
76-
extern u32 omap3_save_secure_ram(void __iomem *save_regs, int size);
76+
extern u32 omap3_save_secure_ram(void *save_regs, int size);
7777

7878
extern u32 rx51_secure_dispatcher(u32 idx, u32 process, u32 flag, u32 nargs,
7979
u32 arg1, u32 arg2, u32 arg3, u32 arg4);

arch/arm/mach-omap2/omap4-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static int __init omap4_sram_init(void)
139139
pr_warn("%s:Unable to get sram pool needed to handle errata I688\n",
140140
__func__);
141141
else
142-
sram_sync = (void *)gen_pool_alloc(sram_pool, PAGE_SIZE);
142+
sram_sync = (void __iomem *)gen_pool_alloc(sram_pool, PAGE_SIZE);
143143

144144
return 0;
145145
}

arch/arm/mach-omap2/sram.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static void *omap_sram_push_address(unsigned long size)
7575
new_ceil = ROUND_DOWN(new_ceil, FNCPY_ALIGN);
7676
omap_sram_ceil = IOMEM(new_ceil);
7777

78-
return (void *)omap_sram_ceil;
78+
return (void __force *)omap_sram_ceil;
7979
}
8080

8181
void *omap_sram_push(void *funcp, unsigned long size)

0 commit comments

Comments
 (0)