diff mbox series

drivers: pci: pcie_dw_common: fix Werror compilation error

Message ID 20210518140856.204973-1-green.wan@sifive.com
State Superseded
Delegated to: Andes
Headers show
Series drivers: pci: pcie_dw_common: fix Werror compilation error | expand

Commit Message

Green Wan May 18, 2021, 2:08 p.m. UTC
Fix compilation error when Werror is turned on. The warning could
possible break some CI builds.

Signed-off-by: Green Wan <green.wan@sifive.com>
---
 drivers/pci/pcie_dw_common.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/drivers/pci/pcie_dw_common.c b/drivers/pci/pcie_dw_common.c
index 785fd3aad0..fde7c36558 100644
--- a/drivers/pci/pcie_dw_common.c
+++ b/drivers/pci/pcie_dw_common.c
@@ -213,7 +213,7 @@  int pcie_dw_read_config(const struct udevice *bus, pci_dev_t bdf,
 
 	va_address = set_cfg_address(pcie, bdf, offset);
 
-	value = readl(va_address);
+	value = readl((void __iomem *)va_address);
 
 	debug("(addr,val)=(0x%04x, 0x%08lx)\n", offset, value);
 	*valuep = pci_conv_32_to_size(value, offset, size);
@@ -257,9 +257,9 @@  int pcie_dw_write_config(struct udevice *bus, pci_dev_t bdf,
 
 	va_address = set_cfg_address(pcie, bdf, offset);
 
-	old = readl(va_address);
+	old = readl((void __iomem *)va_address);
 	value = pci_conv_size_to_32(old, value, offset, size);
-	writel(value, va_address);
+	writel(value, (void __iomem *)va_address);
 
 	return pcie_dw_prog_outbound_atu_unroll(pcie, PCIE_ATU_REGION_INDEX1,
 						 PCIE_ATU_TYPE_IO, pcie->io.phys_start,
@@ -337,28 +337,28 @@  void pcie_dw_setup_host(struct pcie_dw *pci)
 		pci->cfg_base, pci->cfg_base + pci->cfg_size,
 		pci->cfg_size);
 
-	dev_dbg(pci->dev, "IO space: [0x%llx - 0x%llx, size 0x%lx]\n",
+	dev_dbg(pci->dev, "IO space: [0x%llx - 0x%llx, size 0x%llx]\n",
 		pci->io.phys_start, pci->io.phys_start + pci->io.size,
 		pci->io.size);
 
-	dev_dbg(pci->dev, "IO bus:   [0x%lx - 0x%lx, size 0x%lx]\n",
+	dev_dbg(pci->dev, "IO bus:   [0x%llx - 0x%llx, size 0x%llx]\n",
 		pci->io.bus_start, pci->io.bus_start + pci->io.size,
 		pci->io.size);
 
-	dev_dbg(pci->dev, "MEM space: [0x%llx - 0x%llx, size 0x%lx]\n",
+	dev_dbg(pci->dev, "MEM space: [0x%llx - 0x%llx, size 0x%llx]\n",
 		pci->mem.phys_start, pci->mem.phys_start + pci->mem.size,
 		pci->mem.size);
 
-	dev_dbg(pci->dev, "MEM bus:   [0x%lx - 0x%lx, size 0x%lx]\n",
+	dev_dbg(pci->dev, "MEM bus:   [0x%llx - 0x%llx, size 0x%llx]\n",
 		pci->mem.bus_start, pci->mem.bus_start + pci->mem.size,
 		pci->mem.size);
 
 	if (pci->prefetch.size) {
-		dev_dbg(pci->dev, "PREFETCH space: [0x%llx - 0x%llx, size 0x%lx]\n",
+		dev_dbg(pci->dev, "PREFETCH space: [0x%llx - 0x%llx, size 0x%llx]\n",
 			pci->prefetch.phys_start, pci->prefetch.phys_start + pci->prefetch.size,
 			pci->prefetch.size);
 
-		dev_dbg(pci->dev, "PREFETCH bus:   [0x%lx - 0x%lx, size 0x%lx]\n",
+		dev_dbg(pci->dev, "PREFETCH bus:   [0x%llx - 0x%llx, size 0x%llx]\n",
 			pci->prefetch.bus_start, pci->prefetch.bus_start + pci->prefetch.size,
 			pci->prefetch.size);
 	}