ARM: OMAP2+: force iomem for omap_interconnect_sync
Subsystems (3)
PATCH 1/1 ARM: OMAP2+: force iomem for omap_interconnect_sync
Force the type of omap_interconnect_sync to avoid the following sparse warnign:
arch/arm/mach-omap2/omap4-common.c:142:27: warning: incorrect type in assignment (different address spaces)arch/arm/mach-omap2/omap4-common.c:142:27: expected void [noderef] <asn:2> *static [toplevel] sram_syncarch/arm/mach-omap2/omap4-common.c:142:27: got void *
---
Cc: Tony Lindgren <[email protected]>
Cc: Russell King <[email protected]>
Cc: [email protected]
Cc: [email protected]
--- arch/arm/mach-omap2/omap4-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/omap4-common.c +1 -1
@@ -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 __force __iomem *)gen_pool_alloc (sram_pool,PAGE_SIZE );return 0 ; }
Signature · 1 line
2.23.0
Russell King - ARM Linux admin
maintainerQuoted 22 lines · Ben Dooks
Force the type of
omap_interconnect_syncto avoid the following sparse warnign:
arch/arm/mach-omap2/omap4-common.c:142:27: warning: incorrect type in assignment (different address spaces)arch/arm/mach-omap2/omap4-common.c:142:27: expected void [noderef] <asn:2> *static [toplevel]sram_syncarch/arm/mach-omap2/omap4-common.c:142:27: got void *Signed-off-by Ben Dooks <[email protected]>---
Cc: Tony Lindgren <[email protected]>
Cc: Russell King <[email protected]>
Cc: [email protected]
Cc: [email protected]--- arch/arm/mach-omap2/omap4-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-omap2/omap4-common.c +0
-0
arch/arm/mach-omap2/omap4-common.c static int __init omap4_sram_init(void) · line 142
Quoted 5 lines
arch/arm/mach-omap2/omap4-common.c +1
-1@@ -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 __force __iomem *)gen_pool_alloc (sram_pool,PAGE_SIZE );
Not sure about this one - did you check whether the memory returned here really is iomem memory? If it isn't iomem memory, then the warning should remain.
Never hide a valid sparse warning - to do so goes against the whole point of sparse checks. It isn't "pointing out that a cast is missing, we must add a cast", the point of sparse is to find and identify where the code is actually incorrect - in other words, MMIO accessors are used on memory that is not MMIO, or direct dereferences are used on memory that is MMIO. If we go around merely casting the warnings away, it makes sparse completely pointless.
Signature · 3 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up