linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remoteproc: coredump: correct argument 2 type for memcpy_fromio
@ 2021-11-10  3:21 Peng Fan (OSS)
  2021-11-16 18:47 ` Mathieu Poirier
  0 siblings, 1 reply; 3+ messages in thread
From: Peng Fan (OSS) @ 2021-11-10  3:21 UTC (permalink / raw)
  To: ohad, bjorn.andersson, mathieu.poirier, o.rempel
  Cc: shawnguo, s.hauer, kernel, festevam, linux-imx, linux-remoteproc,
	linux-arm-kernel, linux-kernel, Peng Fan, kernel test robot

From: Peng Fan <peng.fan@nxp.com>

Address the sparse check warning:
>> drivers/remoteproc/remoteproc_coredump.c:169:53:
sparse: warning: incorrect type in argument 2 (different address spaces)
sparse:    expected void const volatile [noderef] __iomem *src
sparse:    got void *[assigned] ptr

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/remoteproc/remoteproc_coredump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_coredump.c b/drivers/remoteproc/remoteproc_coredump.c
index aee657cc08c6..f39c98aa1b49 100644
--- a/drivers/remoteproc/remoteproc_coredump.c
+++ b/drivers/remoteproc/remoteproc_coredump.c
@@ -166,7 +166,7 @@ static void rproc_copy_segment(struct rproc *rproc, void *dest,
 			memset(dest, 0xff, size);
 		} else {
 			if (is_iomem)
-				memcpy_fromio(dest, ptr, size);
+				memcpy_fromio(dest, (void const __iomem *)ptr, size);
 			else
 				memcpy(dest, ptr, size);
 		}
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] remoteproc: coredump: correct argument 2 type for memcpy_fromio
  2021-11-10  3:21 [PATCH] remoteproc: coredump: correct argument 2 type for memcpy_fromio Peng Fan (OSS)
@ 2021-11-16 18:47 ` Mathieu Poirier
  2021-11-17  3:34   ` Peng Fan
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Poirier @ 2021-11-16 18:47 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: ohad, bjorn.andersson, o.rempel, shawnguo, s.hauer, kernel,
	festevam, linux-imx, linux-remoteproc, linux-arm-kernel,
	linux-kernel, Peng Fan, kernel test robot

Hi Peng,

On Wed, Nov 10, 2021 at 11:21:01AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Address the sparse check warning:
> >> drivers/remoteproc/remoteproc_coredump.c:169:53:
> sparse: warning: incorrect type in argument 2 (different address spaces)
> sparse:    expected void const volatile [noderef] __iomem *src
> sparse:    got void *[assigned] ptr
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/remoteproc/remoteproc_coredump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/remoteproc_coredump.c b/drivers/remoteproc/remoteproc_coredump.c
> index aee657cc08c6..f39c98aa1b49 100644
> --- a/drivers/remoteproc/remoteproc_coredump.c
> +++ b/drivers/remoteproc/remoteproc_coredump.c
> @@ -166,7 +166,7 @@ static void rproc_copy_segment(struct rproc *rproc, void *dest,
>  			memset(dest, 0xff, size);
>  		} else {
>  			if (is_iomem)
> -				memcpy_fromio(dest, ptr, size);
> +				memcpy_fromio(dest, (void const __iomem *)ptr, size);

Shouldn't this be (const void __iomem *) to respect the signature in [1]?

[1]. https://elixir.bootlin.com/linux/latest/source/include/asm-generic/logic_io.h#L71

>  			else
>  				memcpy(dest, ptr, size);
>  		}
> -- 
> 2.25.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH] remoteproc: coredump: correct argument 2 type for memcpy_fromio
  2021-11-16 18:47 ` Mathieu Poirier
@ 2021-11-17  3:34   ` Peng Fan
  0 siblings, 0 replies; 3+ messages in thread
From: Peng Fan @ 2021-11-17  3:34 UTC (permalink / raw)
  To: Mathieu Poirier, Peng Fan (OSS)
  Cc: ohad@wizery.com, bjorn.andersson@linaro.org,
	o.rempel@pengutronix.de, shawnguo@kernel.org,
	s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com,
	dl-linux-imx, linux-remoteproc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel test robot

Hi Mathieu,

> Subject: Re: [PATCH] remoteproc: coredump: correct argument 2 type for
> memcpy_fromio
> 
> Hi Peng,
> 
> On Wed, Nov 10, 2021 at 11:21:01AM +0800, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Address the sparse check warning:
> > >> drivers/remoteproc/remoteproc_coredump.c:169:53:
> > sparse: warning: incorrect type in argument 2 (different address spaces)
> > sparse:    expected void const volatile [noderef] __iomem *src
> > sparse:    got void *[assigned] ptr
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  drivers/remoteproc/remoteproc_coredump.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/remoteproc/remoteproc_coredump.c
> b/drivers/remoteproc/remoteproc_coredump.c
> > index aee657cc08c6..f39c98aa1b49 100644
> > --- a/drivers/remoteproc/remoteproc_coredump.c
> > +++ b/drivers/remoteproc/remoteproc_coredump.c
> > @@ -166,7 +166,7 @@ static void rproc_copy_segment(struct rproc *rproc,
> void *dest,
> >  			memset(dest, 0xff, size);
> >  		} else {
> >  			if (is_iomem)
> > -				memcpy_fromio(dest, ptr, size);
> > +				memcpy_fromio(dest, (void const __iomem *)ptr, size);
> 
> Shouldn't this be (const void __iomem *) to respect the signature in [1]?

The sparse shows" sparse:    expected void const volatile [noderef] __iomem *src"
I just send out V2 following your suggestion.

Thanks,
Peng.

> 
> [1].
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.b
> ootlin.com%2Flinux%2Flatest%2Fsource%2Finclude%2Fasm-generic%2Flogic_
> io.h%23L71&amp;data=04%7C01%7Cpeng.fan%40nxp.com%7C8c6a9d750ea
> 94f5b09c508d9a931938f%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7
> C0%7C637726852658866042%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4
> wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&a
> mp;sdata=%2BBIKI5lOdwketjCiNhR3YLyK1xx9o7NhPuuLpjGU7J4%3D&amp;r
> eserved=0
> 
> >  			else
> >  				memcpy(dest, ptr, size);
> >  		}
> > --
> > 2.25.1
> >

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-11-17  3:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-10  3:21 [PATCH] remoteproc: coredump: correct argument 2 type for memcpy_fromio Peng Fan (OSS)
2021-11-16 18:47 ` Mathieu Poirier
2021-11-17  3:34   ` Peng Fan

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