linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] cxl: Compile with -Werror
@ 2015-08-07  3:18 Daniel Axtens
  2015-08-07  3:18 ` [PATCH 2/4] cxl: sparse: Make declarations static Daniel Axtens
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Daniel Axtens @ 2015-08-07  3:18 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mpe, benh, mikey, imunsie, Daniel Axtens

It's a good idea, and it brings us in line with the rest of arch/powerpc.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 drivers/misc/cxl/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/misc/cxl/Makefile b/drivers/misc/cxl/Makefile
index 14e3f8219a11..6f484dfe78f9 100644
--- a/drivers/misc/cxl/Makefile
+++ b/drivers/misc/cxl/Makefile
@@ -1,3 +1,5 @@
+ccflags-y := -Werror
+
 cxl-y				+= main.o file.o irq.o fault.o native.o
 cxl-y				+= context.o sysfs.o debugfs.o pci.o trace.o
 cxl-y				+= vphb.o api.o
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/4] cxl: sparse: Make declarations static
  2015-08-07  3:18 [PATCH 1/4] cxl: Compile with -Werror Daniel Axtens
@ 2015-08-07  3:18 ` Daniel Axtens
  2015-08-07  5:48   ` Michael Neuling
  2015-08-13  1:44   ` [2/4] " Michael Ellerman
  2015-08-07  3:18 ` [PATCH 3/4] cxl: sparse: Flag iomem pointers properly Daniel Axtens
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 14+ messages in thread
From: Daniel Axtens @ 2015-08-07  3:18 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mpe, benh, mikey, imunsie, Daniel Axtens

A few declarations were identified by sparse as needing to be static:

/scratch/dja/linux-capi/drivers/misc/cxl/irq.c:408:6: warning: symbol 'afu_irq_name_free' was not declared. Should it be static?
/scratch/dja/linux-capi/drivers/misc/cxl/irq.c:467:6: warning: symbol 'afu_register_hwirqs' was not declared. Should it be static?
/scratch/dja/linux-capi/drivers/misc/cxl/file.c:254:6: warning: symbol 'afu_compat_ioctl' was not declared. Should it be static?
/scratch/dja/linux-capi/drivers/misc/cxl/file.c:399:30: warning: symbol 'afu_master_fops' was not declared. Should it be static?

Make them static.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 drivers/misc/cxl/file.c | 4 ++--
 drivers/misc/cxl/irq.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c
index e3f4b69527a9..c8c8bfa2679b 100644
--- a/drivers/misc/cxl/file.c
+++ b/drivers/misc/cxl/file.c
@@ -251,7 +251,7 @@ long afu_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	return -EINVAL;
 }
 
-long afu_compat_ioctl(struct file *file, unsigned int cmd,
+static long afu_compat_ioctl(struct file *file, unsigned int cmd,
 			     unsigned long arg)
 {
 	return afu_ioctl(file, cmd, arg);
@@ -396,7 +396,7 @@ const struct file_operations afu_fops = {
 	.mmap           = afu_mmap,
 };
 
-const struct file_operations afu_master_fops = {
+static const struct file_operations afu_master_fops = {
 	.owner		= THIS_MODULE,
 	.open           = afu_master_open,
 	.poll		= afu_poll,
diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c
index 680cd263436d..77e5d0e7ebe1 100644
--- a/drivers/misc/cxl/irq.c
+++ b/drivers/misc/cxl/irq.c
@@ -405,7 +405,7 @@ void cxl_release_psl_irq(struct cxl_afu *afu)
 	kfree(afu->psl_irq_name);
 }
 
-void afu_irq_name_free(struct cxl_context *ctx)
+static void afu_irq_name_free(struct cxl_context *ctx)
 {
 	struct cxl_irq_name *irq_name, *tmp;
 
@@ -464,7 +464,7 @@ out:
 	return -ENOMEM;
 }
 
-void afu_register_hwirqs(struct cxl_context *ctx)
+static void afu_register_hwirqs(struct cxl_context *ctx)
 {
 	irq_hw_number_t hwirq;
 	struct cxl_irq_name *irq_name;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/4] cxl: sparse: Flag iomem pointers properly
  2015-08-07  3:18 [PATCH 1/4] cxl: Compile with -Werror Daniel Axtens
  2015-08-07  3:18 ` [PATCH 2/4] cxl: sparse: Make declarations static Daniel Axtens
@ 2015-08-07  3:18 ` Daniel Axtens
  2015-08-07  4:13   ` Michael Neuling
  2015-08-12  3:19   ` [3/4] " Michael Ellerman
  2015-08-07  3:18 ` [PATCH 4/4] cxl: sparse: Silence iomem warning in debugfs file creation Daniel Axtens
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 14+ messages in thread
From: Daniel Axtens @ 2015-08-07  3:18 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mpe, benh, mikey, imunsie, Daniel Axtens

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(-)

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;
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/4] cxl: sparse: Silence iomem warning in debugfs file creation
  2015-08-07  3:18 [PATCH 1/4] cxl: Compile with -Werror Daniel Axtens
  2015-08-07  3:18 ` [PATCH 2/4] cxl: sparse: Make declarations static Daniel Axtens
  2015-08-07  3:18 ` [PATCH 3/4] cxl: sparse: Flag iomem pointers properly Daniel Axtens
@ 2015-08-07  3:18 ` Daniel Axtens
  2015-08-07  4:13   ` Michael Neuling
  2015-08-13  1:44   ` [4/4] " Michael Ellerman
  2015-08-07  3:25 ` [PATCH 1/4] cxl: Compile with -Werror Michael Neuling
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 14+ messages in thread
From: Daniel Axtens @ 2015-08-07  3:18 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mpe, benh, mikey, imunsie, Daniel Axtens

An IO address, tagged with __iomem, is passed to debugfs_create_file
as private data. This requires that it be cast to void *. The cast
creates a sparse warning:
/scratch/dja/linux-capi/drivers/misc/cxl/debugfs.c:51:57: warning: cast removes address space of expression

The address space marker is added back in the file operations
(fops_io_u64).

Silence the warning with __force.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 drivers/misc/cxl/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/cxl/debugfs.c b/drivers/misc/cxl/debugfs.c
index 825c412580bc..18df6f44af2a 100644
--- a/drivers/misc/cxl/debugfs.c
+++ b/drivers/misc/cxl/debugfs.c
@@ -48,7 +48,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_io_x64, debugfs_io_u64_get, debugfs_io_u64_set, "0x
 static struct dentry *debugfs_create_io_x64(const char *name, umode_t mode,
 					    struct dentry *parent, u64 __iomem *value)
 {
-	return debugfs_create_file(name, mode, parent, (void *)value, &fops_io_x64);
+	return debugfs_create_file(name, mode, parent, (void __force *)value, &fops_io_x64);
 }
 
 int cxl_debugfs_adapter_add(struct cxl *adapter)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/4] cxl: Compile with -Werror
  2015-08-07  3:18 [PATCH 1/4] cxl: Compile with -Werror Daniel Axtens
                   ` (2 preceding siblings ...)
  2015-08-07  3:18 ` [PATCH 4/4] cxl: sparse: Silence iomem warning in debugfs file creation Daniel Axtens
@ 2015-08-07  3:25 ` Michael Neuling
  2015-08-07  3:26   ` Daniel Axtens
  2015-08-07  4:13 ` Michael Neuling
  2015-08-13  1:44 ` [1/4] " Michael Ellerman
  5 siblings, 1 reply; 14+ messages in thread
From: Michael Neuling @ 2015-08-07  3:25 UTC (permalink / raw)
  To: Daniel Axtens; +Cc: linuxppc-dev, mpe, benh, imunsie

On Fri, 2015-08-07 at 13:18 +1000, Daniel Axtens wrote:
> It's a good idea, and it brings us in line with the rest of arch/powerpc.

Do you need to put this patch last so that you don't break bisecting the
series?

Mikey

> Signed-off-by: Daniel Axtens <dja@axtens.net>
> ---
>  drivers/misc/cxl/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>=20
> diff --git a/drivers/misc/cxl/Makefile b/drivers/misc/cxl/Makefile
> index 14e3f8219a11..6f484dfe78f9 100644
> --- a/drivers/misc/cxl/Makefile
> +++ b/drivers/misc/cxl/Makefile
> @@ -1,3 +1,5 @@
> +ccflags-y :=3D -Werror
> +
>  cxl-y				+=3D main.o file.o irq.o fault.o native.o
>  cxl-y				+=3D context.o sysfs.o debugfs.o pci.o trace.o
>  cxl-y				+=3D vphb.o api.o

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/4] cxl: Compile with -Werror
  2015-08-07  3:25 ` [PATCH 1/4] cxl: Compile with -Werror Michael Neuling
@ 2015-08-07  3:26   ` Daniel Axtens
  0 siblings, 0 replies; 14+ messages in thread
From: Daniel Axtens @ 2015-08-07  3:26 UTC (permalink / raw)
  To: Michael Neuling; +Cc: linuxppc-dev, mpe, benh, imunsie

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

> Do you need to put this patch last so that you don't break bisecting the
> series?
> 
The warnings fixed in the rest of the series are from sparse, not the
compiler, so they don't break building with -Werror.

-- 
Regards,
Daniel

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 860 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/4] cxl: Compile with -Werror
  2015-08-07  3:18 [PATCH 1/4] cxl: Compile with -Werror Daniel Axtens
                   ` (3 preceding siblings ...)
  2015-08-07  3:25 ` [PATCH 1/4] cxl: Compile with -Werror Michael Neuling
@ 2015-08-07  4:13 ` Michael Neuling
  2015-08-13  1:44 ` [1/4] " Michael Ellerman
  5 siblings, 0 replies; 14+ messages in thread
From: Michael Neuling @ 2015-08-07  4:13 UTC (permalink / raw)
  To: Daniel Axtens; +Cc: linuxppc-dev, mpe, benh, imunsie

On Fri, 2015-08-07 at 13:18 +1000, Daniel Axtens wrote:
> It's a good idea, and it brings us in line with the rest of arch/powerpc.
>=20
> Signed-off-by: Daniel Axtens <dja@axtens.net>

Acked-by: Michael Neuling <mikey@neuling.org>

> ---
>  drivers/misc/cxl/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>=20
> diff --git a/drivers/misc/cxl/Makefile b/drivers/misc/cxl/Makefile
> index 14e3f8219a11..6f484dfe78f9 100644
> --- a/drivers/misc/cxl/Makefile
> +++ b/drivers/misc/cxl/Makefile
> @@ -1,3 +1,5 @@
> +ccflags-y :=3D -Werror
> +
>  cxl-y				+=3D main.o file.o irq.o fault.o native.o
>  cxl-y				+=3D context.o sysfs.o debugfs.o pci.o trace.o
>  cxl-y				+=3D vphb.o api.o

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/4] cxl: sparse: Flag iomem pointers properly
  2015-08-07  3:18 ` [PATCH 3/4] cxl: sparse: Flag iomem pointers properly Daniel Axtens
@ 2015-08-07  4:13   ` Michael Neuling
  2015-08-12  3:19   ` [3/4] " Michael Ellerman
  1 sibling, 0 replies; 14+ messages in thread
From: Michael Neuling @ 2015-08-07  4:13 UTC (permalink / raw)
  To: Daniel Axtens; +Cc: linuxppc-dev, mpe, benh, imunsie

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 <dja@axtens.net>

Acked-by: Michael Neuling <mikey@neuling.org>

> ---
>  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,
>  		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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 4/4] cxl: sparse: Silence iomem warning in debugfs file creation
  2015-08-07  3:18 ` [PATCH 4/4] cxl: sparse: Silence iomem warning in debugfs file creation Daniel Axtens
@ 2015-08-07  4:13   ` Michael Neuling
  2015-08-13  1:44   ` [4/4] " Michael Ellerman
  1 sibling, 0 replies; 14+ messages in thread
From: Michael Neuling @ 2015-08-07  4:13 UTC (permalink / raw)
  To: Daniel Axtens; +Cc: linuxppc-dev, mpe, benh, imunsie

On Fri, 2015-08-07 at 13:18 +1000, Daniel Axtens wrote:
> An IO address, tagged with __iomem, is passed to debugfs_create_file
> as private data. This requires that it be cast to void *. The cast
> creates a sparse warning:
> /scratch/dja/linux-capi/drivers/misc/cxl/debugfs.c:51:57: warning: cast r=
emoves address space of expression
>=20
> The address space marker is added back in the file operations
> (fops_io_u64).
>=20
> Silence the warning with __force.
>=20
> Signed-off-by: Daniel Axtens <dja@axtens.net>

Acked-by: Michael Neuling <mikey@neuling.org>

> ---
>  drivers/misc/cxl/debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>=20
> diff --git a/drivers/misc/cxl/debugfs.c b/drivers/misc/cxl/debugfs.c
> index 825c412580bc..18df6f44af2a 100644
> --- a/drivers/misc/cxl/debugfs.c
> +++ b/drivers/misc/cxl/debugfs.c
> @@ -48,7 +48,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_io_x64, debugfs_io_u64_get=
, debugfs_io_u64_set, "0x
>  static struct dentry *debugfs_create_io_x64(const char *name, umode_t mo=
de,
>  					    struct dentry *parent, u64 __iomem *value)
>  {
> -	return debugfs_create_file(name, mode, parent, (void *)value, &fops_io_=
x64);
> +	return debugfs_create_file(name, mode, parent, (void __force *)value, &=
fops_io_x64);
>  }
> =20
>  int cxl_debugfs_adapter_add(struct cxl *adapter)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/4] cxl: sparse: Make declarations static
  2015-08-07  3:18 ` [PATCH 2/4] cxl: sparse: Make declarations static Daniel Axtens
@ 2015-08-07  5:48   ` Michael Neuling
  2015-08-13  1:44   ` [2/4] " Michael Ellerman
  1 sibling, 0 replies; 14+ messages in thread
From: Michael Neuling @ 2015-08-07  5:48 UTC (permalink / raw)
  To: Daniel Axtens; +Cc: linuxppc-dev, imunsie

On Fri, 2015-08-07 at 13:18 +1000, Daniel Axtens wrote:
> A few declarations were identified by sparse as needing to be static:
>=20
> /scratch/dja/linux-capi/drivers/misc/cxl/irq.c:408:6: warning: symbol 'af=
u_irq_name_free' was not declared. Should it be static?
> /scratch/dja/linux-capi/drivers/misc/cxl/irq.c:467:6: warning: symbol 'af=
u_register_hwirqs' was not declared. Should it be static?
> /scratch/dja/linux-capi/drivers/misc/cxl/file.c:254:6: warning: symbol 'a=
fu_compat_ioctl' was not declared. Should it be static?
> /scratch/dja/linux-capi/drivers/misc/cxl/file.c:399:30: warning: symbol '=
afu_master_fops' was not declared. Should it be static?
>=20
> Make them static.
>=20
> Signed-off-by: Daniel Axtens <dja@axtens.net>

Acked-by: Michael Neuling <mikey@neuling.org>

> ---
>  drivers/misc/cxl/file.c | 4 ++--
>  drivers/misc/cxl/irq.c  | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
>=20
> diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c
> index e3f4b69527a9..c8c8bfa2679b 100644
> --- a/drivers/misc/cxl/file.c
> +++ b/drivers/misc/cxl/file.c
> @@ -251,7 +251,7 @@ long afu_ioctl(struct file *file, unsigned int cmd, u=
nsigned long arg)
>  	return -EINVAL;
>  }
> =20
> -long afu_compat_ioctl(struct file *file, unsigned int cmd,
> +static long afu_compat_ioctl(struct file *file, unsigned int cmd,
>  			     unsigned long arg)
>  {
>  	return afu_ioctl(file, cmd, arg);
> @@ -396,7 +396,7 @@ const struct file_operations afu_fops =3D {
>  	.mmap           =3D afu_mmap,
>  };
> =20
> -const struct file_operations afu_master_fops =3D {
> +static const struct file_operations afu_master_fops =3D {
>  	.owner		=3D THIS_MODULE,
>  	.open           =3D afu_master_open,
>  	.poll		=3D afu_poll,
> diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c
> index 680cd263436d..77e5d0e7ebe1 100644
> --- a/drivers/misc/cxl/irq.c
> +++ b/drivers/misc/cxl/irq.c
> @@ -405,7 +405,7 @@ void cxl_release_psl_irq(struct cxl_afu *afu)
>  	kfree(afu->psl_irq_name);
>  }
> =20
> -void afu_irq_name_free(struct cxl_context *ctx)
> +static void afu_irq_name_free(struct cxl_context *ctx)
>  {
>  	struct cxl_irq_name *irq_name, *tmp;
> =20
> @@ -464,7 +464,7 @@ out:
>  	return -ENOMEM;
>  }
> =20
> -void afu_register_hwirqs(struct cxl_context *ctx)
> +static void afu_register_hwirqs(struct cxl_context *ctx)
>  {
>  	irq_hw_number_t hwirq;
>  	struct cxl_irq_name *irq_name;

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [3/4] cxl: sparse: Flag iomem pointers properly
  2015-08-07  3:18 ` [PATCH 3/4] cxl: sparse: Flag iomem pointers properly Daniel Axtens
  2015-08-07  4:13   ` Michael Neuling
@ 2015-08-12  3:19   ` Michael Ellerman
  1 sibling, 0 replies; 14+ messages in thread
From: Michael Ellerman @ 2015-08-12  3:19 UTC (permalink / raw)
  To: Daniel Axtens, linuxppc-dev; +Cc: mikey, Daniel Axtens, imunsie

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [2/4] cxl: sparse: Make declarations static
  2015-08-07  3:18 ` [PATCH 2/4] cxl: sparse: Make declarations static Daniel Axtens
  2015-08-07  5:48   ` Michael Neuling
@ 2015-08-13  1:44   ` Michael Ellerman
  1 sibling, 0 replies; 14+ messages in thread
From: Michael Ellerman @ 2015-08-13  1:44 UTC (permalink / raw)
  To: Daniel Axtens, linuxppc-dev; +Cc: mikey, Daniel Axtens, imunsie

On Fri, 2015-07-08 at 03:18:18 UTC, Daniel Axtens wrote:
> A few declarations were identified by sparse as needing to be static:
> 
> /scratch/dja/linux-capi/drivers/misc/cxl/irq.c:408:6: warning: symbol 'afu_irq_name_free' was not declared. Should it be static?
> /scratch/dja/linux-capi/drivers/misc/cxl/irq.c:467:6: warning: symbol 'afu_register_hwirqs' was not declared. Should it be static?
> /scratch/dja/linux-capi/drivers/misc/cxl/file.c:254:6: warning: symbol 'afu_compat_ioctl' was not declared. Should it be static?
> /scratch/dja/linux-capi/drivers/misc/cxl/file.c:399:30: warning: symbol 'afu_master_fops' was not declared. Should it be static?
> 
> Make them static.
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> Acked-by: Michael Neuling <mikey@neuling.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/3d6b040e73387570521d

cheers

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [4/4] cxl: sparse: Silence iomem warning in debugfs file creation
  2015-08-07  3:18 ` [PATCH 4/4] cxl: sparse: Silence iomem warning in debugfs file creation Daniel Axtens
  2015-08-07  4:13   ` Michael Neuling
@ 2015-08-13  1:44   ` Michael Ellerman
  1 sibling, 0 replies; 14+ messages in thread
From: Michael Ellerman @ 2015-08-13  1:44 UTC (permalink / raw)
  To: Daniel Axtens, linuxppc-dev; +Cc: mikey, Daniel Axtens, imunsie

On Fri, 2015-07-08 at 03:18:20 UTC, Daniel Axtens wrote:
> An IO address, tagged with __iomem, is passed to debugfs_create_file
> as private data. This requires that it be cast to void *. The cast
> creates a sparse warning:
> /scratch/dja/linux-capi/drivers/misc/cxl/debugfs.c:51:57: warning: cast removes address space of expression
> 
> The address space marker is added back in the file operations
> (fops_io_u64).
> 
> Silence the warning with __force.
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> Acked-by: Michael Neuling <mikey@neuling.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/83c3fee7e78f5a937b73

cheers

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [1/4] cxl: Compile with -Werror
  2015-08-07  3:18 [PATCH 1/4] cxl: Compile with -Werror Daniel Axtens
                   ` (4 preceding siblings ...)
  2015-08-07  4:13 ` Michael Neuling
@ 2015-08-13  1:44 ` Michael Ellerman
  5 siblings, 0 replies; 14+ messages in thread
From: Michael Ellerman @ 2015-08-13  1:44 UTC (permalink / raw)
  To: Daniel Axtens, linuxppc-dev; +Cc: mikey, Daniel Axtens, imunsie

On Fri, 2015-07-08 at 03:18:17 UTC, Daniel Axtens wrote:
> It's a good idea, and it brings us in line with the rest of arch/powerpc.
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> Acked-by: Michael Neuling <mikey@neuling.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/d3d73f4b38a8ece19846

cheers

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-08-13  1:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-07  3:18 [PATCH 1/4] cxl: Compile with -Werror Daniel Axtens
2015-08-07  3:18 ` [PATCH 2/4] cxl: sparse: Make declarations static Daniel Axtens
2015-08-07  5:48   ` Michael Neuling
2015-08-13  1:44   ` [2/4] " Michael Ellerman
2015-08-07  3:18 ` [PATCH 3/4] cxl: sparse: Flag iomem pointers properly Daniel Axtens
2015-08-07  4:13   ` Michael Neuling
2015-08-12  3:19   ` [3/4] " Michael Ellerman
2015-08-07  3:18 ` [PATCH 4/4] cxl: sparse: Silence iomem warning in debugfs file creation Daniel Axtens
2015-08-07  4:13   ` Michael Neuling
2015-08-13  1:44   ` [4/4] " Michael Ellerman
2015-08-07  3:25 ` [PATCH 1/4] cxl: Compile with -Werror Michael Neuling
2015-08-07  3:26   ` Daniel Axtens
2015-08-07  4:13 ` Michael Neuling
2015-08-13  1:44 ` [1/4] " Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).