Skip to contentSkip to conversation

PCI: xgene: Annotate __iomem pointer

PATCH Applied Bjorn Helgaas 2 participants 2 messages May 17, 2021 – Jun 3, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: xgene: Annotate __iomem pointer

From: Bjorn Helgaas <[email protected]>

"bar_addr" is passed as the argument to writel(), which expects a "void __iomem *". Annotate "bar_addr" correctly. Resolves an sparse "incorrect type in argument 2 (different address spaces)" warning.

---
 drivers/pci/controller/pci-xgene.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/pci-xgene.c +1 -1
index 7f503dd4ff81..1a412f5377fb 100644
@@ -485,7 +485,7 @@ static void xgene_pcie_setup_ib_reg(struct xgene_pcie_port *port,
 {
 	void __iomem *cfg_base = port->cfg_base;
 	struct device *dev = port->dev;
-	void *bar_addr;
+	void __iomem *bar_addr;
 	u32 pim_reg;
 	u64 cpu_addr = entry->res->start;
 	u64 pci_addr = cpu_addr - entry->offset;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 3 lines · Bjorn Helgaas

"bar_addr" is passed as the argument to writel(), which expects a "void __iomem *". Annotate "bar_addr" correctly. Resolves an sparse "incorrect type in argument 2 (different address spaces)" warning.

Applied to pci/xgene, thanks!

[1/1] PCI: xgene: Annotate __iomem pointer
https://git.kernel.org/lpieralisi/pci/c/eabbc3ccbe

Thanks,
Lorenzo