[PATCH 01/15] PCI: dwc: Fix pointer width cast problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Casting to u32 works well on 32-bit builds, but causes problem when
compiled on 64-bit machines. Switch it to cast to "unsigned long", so
that it would have appropriate width in both cases.

While at it, replace explicit casts to void * with IOMEM.

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 drivers/pci/pcie-designware-host.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pcie-designware-host.c b/drivers/pci/pcie-designware-host.c
index 5acd47f6e..7a95b2a09 100644
--- a/drivers/pci/pcie-designware-host.c
+++ b/drivers/pci/pcie-designware-host.c
@@ -150,15 +150,15 @@ int __init dw_pcie_host_init(struct pcie_port *pp)
 	}
 
 	if (!pci->dbi_base)
-		pci->dbi_base = (void __force *)pp->cfg.start;
+		pci->dbi_base = IOMEM(pp->cfg.start);
 
 	pp->mem_base = pp->mem.start;
 
 	if (!pp->va_cfg0_base)
-		pp->va_cfg0_base = (void __force *)(u32)pp->cfg0_base;
+		pp->va_cfg0_base = IOMEM((unsigned long)pp->cfg0_base);
 
 	if (!pp->va_cfg1_base)
-		pp->va_cfg1_base = (void __force *)(u32)pp->cfg1_base;
+		pp->va_cfg1_base = IOMEM((unsigned long)pp->cfg1_base);
 
 	ret = of_property_read_u32(np, "num-viewport", &pci->num_viewport);
 	if (ret)
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux