Thread (14 messages) flat view 14 messages, 3 authors, 2015-08-13

Re: [PATCH 3/4] cxl: sparse: Flag iomem pointers properly

From: Michael Neuling <hidden>
Date: 2015-08-07 04:13:10

On Fri, 2015-08-07 at 13:18 +1000, Daniel Axtens wrote:
Sparse identifies the following address space issues:
/scratch/dja/linux-capi/drivers/misc/cxl/vphb.c:125:17: warning: incorrec=
t type in assignment (different address spaces)
/scratch/dja/linux-capi/drivers/misc/cxl/vphb.c:125:17:    expected void =
volatile [noderef] <asn:2>*<noident>
/scratch/dja/linux-capi/drivers/misc/cxl/vphb.c:125:17:    got void *<noi=
dent>
/scratch/dja/linux-capi/drivers/misc/cxl/vphb.c:220:23: warning: incorrec=
t type in assignment (different address spaces)
/scratch/dja/linux-capi/drivers/misc/cxl/vphb.c:220:23:    expected void =
[noderef] <asn:2>*cfg_data
/scratch/dja/linux-capi/drivers/misc/cxl/vphb.c:220:23:    got void *<noi=
dent>
=20
Fix those by flagging __iomem in the relevant casts.
=20
Signed-off-by: Daniel Axtens <redacted>
Acked-by: Michael Neuling <redacted>
quoted hunk ↗ jump to hunk
---
 drivers/misc/cxl/vphb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
=20
diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c
index 2eba002b580b..a7b55772a91c 100644
--- a/drivers/misc/cxl/vphb.c
+++ b/drivers/misc/cxl/vphb.c
@@ -122,7 +122,7 @@ static int cxl_pcie_config_info(struct pci_bus *bus, =
unsigned int devfn,
quoted hunk ↗ jump to hunk
 		return PCIBIOS_BAD_REGISTER_NUMBER;
 	addr =3D cxl_pcie_cfg_addr(phb, bus->number, devfn, offset);
=20
-	*ioaddr =3D (void *)(addr & ~0x3ULL);
+	*ioaddr =3D (void __iomem *)(addr & ~0x3ULL);
 	*shift =3D ((addr & 0x3) * 8);
 	switch (len) {
 	case 1:
@@ -217,7 +217,7 @@ int cxl_pci_vphb_add(struct cxl_afu *afu)
 	/* Setup the PHB using arch provided callback */
 	phb->ops =3D &cxl_pcie_pci_ops;
 	phb->cfg_addr =3D afu->afu_desc_mmio + afu->crs_offset;
-	phb->cfg_data =3D (void *)(u64)afu->crs_len;
+	phb->cfg_data =3D (void __iomem *)(u64)afu->crs_len;
 	phb->private_data =3D afu;
 	phb->controller_ops =3D cxl_pci_controller_ops;
=20
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help