Re: [PATCH] pci: iproc-msi: fix __iomem annotation in decode_msi_hwirq()

2019-10-17 Thread Lorenzo Pieralisi
On Tue, Oct 15, 2019 at 05:07:02PM +0100, Ben Dooks (Codethink) wrote:
> Fix __iomem attribute on msg variable passed to readl() in
> the decode_msi_hwirq() function. Fixes the following sparse
> warning:
> 
> drivers/pci/controller/pcie-iproc-msi.c:301:17: warning: incorrect type in 
> argument 1 (different address spaces)
> drivers/pci/controller/pcie-iproc-msi.c:301:17:expected void const 
> volatile [noderef]  *addr
> drivers/pci/controller/pcie-iproc-msi.c:301:17:got unsigned int 
> [usertype] *[assigned] msg
> 
> Signed-off-by: Ben Dooks 
> ---
> Cc: Lorenzo Pieralisi 
> Cc: Andrew Murray 
> Cc: Bjorn Helgaas 
> Cc: Ray Jui 
> Cc: Scott Branden 
> Cc: bcm-kernel-feedback-l...@broadcom.com
> Cc: linux-...@vger.kernel.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> .. (open list)
> ---
>  drivers/pci/controller/pcie-iproc-msi.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Applied to pci/misc, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/pcie-iproc-msi.c 
> b/drivers/pci/controller/pcie-iproc-msi.c
> index 0a3f61be5625..3176ad3ab0e5 100644
> --- a/drivers/pci/controller/pcie-iproc-msi.c
> +++ b/drivers/pci/controller/pcie-iproc-msi.c
> @@ -293,11 +293,12 @@ static const struct irq_domain_ops msi_domain_ops = {
>  
>  static inline u32 decode_msi_hwirq(struct iproc_msi *msi, u32 eq, u32 head)
>  {
> - u32 *msg, hwirq;
> + u32 __iomem *msg;
> + u32 hwirq;
>   unsigned int offs;
>  
>   offs = iproc_msi_eq_offset(msi, eq) + head * sizeof(u32);
> - msg = (u32 *)(msi->eq_cpu + offs);
> + msg = (u32 __iomem *)(msi->eq_cpu + offs);
>   hwirq = readl(msg);
>   hwirq = (hwirq >> 5) + (hwirq & 0x1f);
>  
> -- 
> 2.23.0
> 


[PATCH] pci: iproc-msi: fix __iomem annotation in decode_msi_hwirq()

2019-10-15 Thread Ben Dooks (Codethink)
Fix __iomem attribute on msg variable passed to readl() in
the decode_msi_hwirq() function. Fixes the following sparse
warning:

drivers/pci/controller/pcie-iproc-msi.c:301:17: warning: incorrect type in 
argument 1 (different address spaces)
drivers/pci/controller/pcie-iproc-msi.c:301:17:expected void const volatile 
[noderef]  *addr
drivers/pci/controller/pcie-iproc-msi.c:301:17:got unsigned int [usertype] 
*[assigned] msg

Signed-off-by: Ben Dooks 
---
Cc: Lorenzo Pieralisi 
Cc: Andrew Murray 
Cc: Bjorn Helgaas 
Cc: Ray Jui 
Cc: Scott Branden 
Cc: bcm-kernel-feedback-l...@broadcom.com
Cc: linux-...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
.. (open list)
---
 drivers/pci/controller/pcie-iproc-msi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pcie-iproc-msi.c 
b/drivers/pci/controller/pcie-iproc-msi.c
index 0a3f61be5625..3176ad3ab0e5 100644
--- a/drivers/pci/controller/pcie-iproc-msi.c
+++ b/drivers/pci/controller/pcie-iproc-msi.c
@@ -293,11 +293,12 @@ static const struct irq_domain_ops msi_domain_ops = {
 
 static inline u32 decode_msi_hwirq(struct iproc_msi *msi, u32 eq, u32 head)
 {
-   u32 *msg, hwirq;
+   u32 __iomem *msg;
+   u32 hwirq;
unsigned int offs;
 
offs = iproc_msi_eq_offset(msi, eq) + head * sizeof(u32);
-   msg = (u32 *)(msi->eq_cpu + offs);
+   msg = (u32 __iomem *)(msi->eq_cpu + offs);
hwirq = readl(msg);
hwirq = (hwirq >> 5) + (hwirq & 0x1f);
 
-- 
2.23.0