Message ID | 1438917500-12100-3-git-send-email-dja@axtens.net (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Michael Ellerman |
Headers | show |
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: incorrect 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 *<noident> > /scratch/dja/linux-capi/drivers/misc/cxl/vphb.c:220:23: warning: incorrect 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 *<noident> > > Fix those by flagging __iomem in the relevant casts. > > Signed-off-by: Daniel Axtens <dja@axtens.net> Acked-by: Michael Neuling <mikey@neuling.org> > --- > drivers/misc/cxl/vphb.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > 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, > return PCIBIOS_BAD_REGISTER_NUMBER; > addr = cxl_pcie_cfg_addr(phb, bus->number, devfn, offset); > > - *ioaddr = (void *)(addr & ~0x3ULL); > + *ioaddr = (void __iomem *)(addr & ~0x3ULL); > *shift = ((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 = &cxl_pcie_pci_ops; > phb->cfg_addr = afu->afu_desc_mmio + afu->crs_offset; > - phb->cfg_data = (void *)(u64)afu->crs_len; > + phb->cfg_data = (void __iomem *)(u64)afu->crs_len; > phb->private_data = afu; > phb->controller_ops = cxl_pci_controller_ops; >
On Fri, 2015-07-08 at 03:18:19 UTC, Daniel Axtens wrote: > Sparse identifies the following address space issues: > /scratch/dja/linux-capi/drivers/misc/cxl/vphb.c:125:17: warning: incorrect 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 *<noident> > /scratch/dja/linux-capi/drivers/misc/cxl/vphb.c:220:23: warning: incorrect 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 *<noident> Please trim these to just the sub-path under linux, and a two space indent is nice: drivers/misc/cxl/vphb.c:220:23: got void *<noident> > Fix those by flagging __iomem in the relevant casts. > > Signed-off-by: Daniel Axtens <dja@axtens.net> > Acked-by: Michael Neuling <mikey@neuling.org> > --- > drivers/misc/cxl/vphb.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > 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, > return PCIBIOS_BAD_REGISTER_NUMBER; > addr = cxl_pcie_cfg_addr(phb, bus->number, devfn, offset); > > - *ioaddr = (void *)(addr & ~0x3ULL); > + *ioaddr = (void __iomem *)(addr & ~0x3ULL); But shouldn't cxl_pcie_cfg_addr() be returning something that is __iomem ? > @@ -217,7 +217,7 @@ int cxl_pci_vphb_add(struct cxl_afu *afu) > /* Setup the PHB using arch provided callback */ > phb->ops = &cxl_pcie_pci_ops; > phb->cfg_addr = afu->afu_desc_mmio + afu->crs_offset; > - phb->cfg_data = (void *)(u64)afu->crs_len; > + phb->cfg_data = (void __iomem *)(u64)afu->crs_len; crs_len is already a u64 so that u64 cast is pointless. cheers
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, return PCIBIOS_BAD_REGISTER_NUMBER; addr = cxl_pcie_cfg_addr(phb, bus->number, devfn, offset); - *ioaddr = (void *)(addr & ~0x3ULL); + *ioaddr = (void __iomem *)(addr & ~0x3ULL); *shift = ((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 = &cxl_pcie_pci_ops; phb->cfg_addr = afu->afu_desc_mmio + afu->crs_offset; - phb->cfg_data = (void *)(u64)afu->crs_len; + phb->cfg_data = (void __iomem *)(u64)afu->crs_len; phb->private_data = afu; phb->controller_ops = cxl_pci_controller_ops;
Sparse identifies the following address space issues: /scratch/dja/linux-capi/drivers/misc/cxl/vphb.c:125:17: warning: incorrect 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 *<noident> /scratch/dja/linux-capi/drivers/misc/cxl/vphb.c:220:23: warning: incorrect 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 *<noident> Fix those by flagging __iomem in the relevant casts. Signed-off-by: Daniel Axtens <dja@axtens.net> --- drivers/misc/cxl/vphb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)