diff mbox series

remoteproc: rcar_rproc: silince address space sparse warning

Message ID 20220808011610.188119-2-wangkefeng.wang@huawei.com (mailing list archive)
State New, archived
Headers show
Series remoteproc: rcar_rproc: silince address space sparse warning | expand

Commit Message

Kefeng Wang Aug. 8, 2022, 1:16 a.m. UTC
Fix sparse warnings,
   drivers/remoteproc/st_remoteproc.c:98:12: sparse: sparse: incorrect type in assignment (different address spaces) @@
	   expected void *va @@     got void [noderef] __iomem * @@
   drivers/remoteproc/st_remoteproc.c:98:12: sparse:     expected void *va
   drivers/remoteproc/st_remoteproc.c:98:12: sparse:     got void [noderef] __iomem *
   ...
   drivers/remoteproc/st_remoteproc.c:114:20: sparse:     expected void volatile [noderef] __iomem *io_addr
   drivers/remoteproc/st_remoteproc.c:114:20: sparse:     got void *va

Add __iomem to io address space 'va' to fix it.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
note: the commit d803336abdbc "(ARM: mm: kill unused runtime hook arch_iounmap())"
won't introduce the warning, but lkp report issue to me many times,
let's fix it.

 drivers/remoteproc/rcar_rproc.c | 2 +-
 include/linux/remoteproc.h      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Kefeng Wang Aug. 8, 2022, 1:12 a.m. UTC | #1
ignore this oneļ¼Œ send the patch twice.

On 2022/8/8 9:16, Kefeng Wang wrote:
> Fix sparse warnings,
>     drivers/remoteproc/st_remoteproc.c:98:12: sparse: sparse: incorrect type in assignment (different address spaces) @@
> 	   expected void *va @@     got void [noderef] __iomem * @@
>     drivers/remoteproc/st_remoteproc.c:98:12: sparse:     expected void *va
>     drivers/remoteproc/st_remoteproc.c:98:12: sparse:     got void [noderef] __iomem *
>     ...
>     drivers/remoteproc/st_remoteproc.c:114:20: sparse:     expected void volatile [noderef] __iomem *io_addr
>     drivers/remoteproc/st_remoteproc.c:114:20: sparse:     got void *va
>
> Add __iomem to io address space 'va' to fix it.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> note: the commit d803336abdbc "(ARM: mm: kill unused runtime hook arch_iounmap())"
> won't introduce the warning, but lkp report issue to me many times,
> let's fix it.
>
>   drivers/remoteproc/rcar_rproc.c | 2 +-
>   include/linux/remoteproc.h      | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/rcar_rproc.c b/drivers/remoteproc/rcar_rproc.c
> index aa86154109c7..e3363a4cde0a 100644
> --- a/drivers/remoteproc/rcar_rproc.c
> +++ b/drivers/remoteproc/rcar_rproc.c
> @@ -22,7 +22,7 @@ static int rcar_rproc_mem_alloc(struct rproc *rproc,
>   				 struct rproc_mem_entry *mem)
>   {
>   	struct device *dev = &rproc->dev;
> -	void *va;
> +	void __iomem *va;
>   
>   	dev_dbg(dev, "map memory: %pa+%zx\n", &mem->dma, mem->len);
>   	va = ioremap_wc(mem->dma, mem->len);
> diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
> index 7c943f0a2fc4..c0c950cf7d72 100644
> --- a/include/linux/remoteproc.h
> +++ b/include/linux/remoteproc.h
> @@ -330,7 +330,7 @@ struct rproc;
>    * @alloc: specific memory allocator function
>    */
>   struct rproc_mem_entry {
> -	void *va;
> +	void __iomem *va;
>   	bool is_iomem;
>   	dma_addr_t dma;
>   	size_t len;
diff mbox series

Patch

diff --git a/drivers/remoteproc/rcar_rproc.c b/drivers/remoteproc/rcar_rproc.c
index aa86154109c7..e3363a4cde0a 100644
--- a/drivers/remoteproc/rcar_rproc.c
+++ b/drivers/remoteproc/rcar_rproc.c
@@ -22,7 +22,7 @@  static int rcar_rproc_mem_alloc(struct rproc *rproc,
 				 struct rproc_mem_entry *mem)
 {
 	struct device *dev = &rproc->dev;
-	void *va;
+	void __iomem *va;
 
 	dev_dbg(dev, "map memory: %pa+%zx\n", &mem->dma, mem->len);
 	va = ioremap_wc(mem->dma, mem->len);
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 7c943f0a2fc4..c0c950cf7d72 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -330,7 +330,7 @@  struct rproc;
  * @alloc: specific memory allocator function
  */
 struct rproc_mem_entry {
-	void *va;
+	void __iomem *va;
 	bool is_iomem;
 	dma_addr_t dma;
 	size_t len;