From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH 14/23] memory: ti-emif-pm: Fix cast to iomem pointer Date: Thu, 23 Jul 2020 10:48:19 +0200 Message-ID: References: <20200723073744.13400-1-krzk@kernel.org> <20200723073744.13400-15-krzk@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20200723073744.13400-15-krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Krzysztof Kozlowski Cc: Olof Johansson , arm-soc , SoC Team , Markus Mayer , bcm-kernel-feedback-list , Florian Fainelli , Santosh Shilimkar , Matthias Brugger , Roger Quadros , Tony Lindgren , Vladimir Zapolskiy , Thierry Reding , Jonathan Hunter , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Linux ARM , "moderated list:ARM/Mediatek SoC..." , linux-omap "open list:TEGRA ARCHITECTURE SUPPORT"
  • List-Id: linux-tegra@vger.kernel.org On Thu, Jul 23, 2020 at 9:39 AM Krzysztof Kozlowski wrote: > > Cast pointer to iomem memory properly to fix sparse warning: > > drivers/memory/ti-emif-pm.c:251:38: warning: incorrect type in argument 1 (different address spaces) > drivers/memory/ti-emif-pm.c:251:38: expected void const volatile [noderef] __iomem *addr > drivers/memory/ti-emif-pm.c:251:38: got void * > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/memory/ti-emif-pm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/memory/ti-emif-pm.c b/drivers/memory/ti-emif-pm.c > index 9c90f815ad3a..6c747c1e98cb 100644 > --- a/drivers/memory/ti-emif-pm.c > +++ b/drivers/memory/ti-emif-pm.c > @@ -248,7 +248,7 @@ MODULE_DEVICE_TABLE(of, ti_emif_of_match); > static int ti_emif_resume(struct device *dev) > { > unsigned long tmp = > - __raw_readl((void *)emif_instance->ti_emif_sram_virt); > + __raw_readl((void __iomem *)emif_instance->ti_emif_sram_virt); > Maybe this shouldn't even be __raw_readl(), but instead READ_ONCE()? The other accesses in this file don't use MMIO wrappers either but just treat it as a pointer. The effect would be the same though. Arnd