drivers/remoteproc/stm32_rproc.c:109:12: sparse: sparse: incorrect type in assignment (different address spaces)

From: kernel test robot
Date: Sat Jun 27 2020 - 17:11:41 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4e99b32169e84b4ece5a1d74eb0b7e4ef07866b3
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 9 days ago
config: arm-randconfig-s031-20200628 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
make W=1 C=1 ARCH=arm CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

>> drivers/remoteproc/stm32_rproc.c:109:12: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *va @@ got void [noderef] __iomem * @@
drivers/remoteproc/stm32_rproc.c:109:12: sparse: expected void *va
>> drivers/remoteproc/stm32_rproc.c:109:12: sparse: got void [noderef] __iomem *
>> drivers/remoteproc/stm32_rproc.c:126:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *iomem_cookie @@ got void *va @@
>> drivers/remoteproc/stm32_rproc.c:126:20: sparse: expected void volatile [noderef] __iomem *iomem_cookie
drivers/remoteproc/stm32_rproc.c:126:20: sparse: got void *va

vim +109 drivers/remoteproc/stm32_rproc.c

13140de09cc2dd Fabien Dessenne 2019-05-14 101
13140de09cc2dd Fabien Dessenne 2019-05-14 102 static int stm32_rproc_mem_alloc(struct rproc *rproc,
13140de09cc2dd Fabien Dessenne 2019-05-14 103 struct rproc_mem_entry *mem)
13140de09cc2dd Fabien Dessenne 2019-05-14 104 {
13140de09cc2dd Fabien Dessenne 2019-05-14 105 struct device *dev = rproc->dev.parent;
13140de09cc2dd Fabien Dessenne 2019-05-14 106 void *va;
13140de09cc2dd Fabien Dessenne 2019-05-14 107
13140de09cc2dd Fabien Dessenne 2019-05-14 108 dev_dbg(dev, "map memory: %pa+%x\n", &mem->dma, mem->len);
13140de09cc2dd Fabien Dessenne 2019-05-14 @109 va = ioremap_wc(mem->dma, mem->len);
13140de09cc2dd Fabien Dessenne 2019-05-14 110 if (IS_ERR_OR_NULL(va)) {
13140de09cc2dd Fabien Dessenne 2019-05-14 111 dev_err(dev, "Unable to map memory region: %pa+%x\n",
13140de09cc2dd Fabien Dessenne 2019-05-14 112 &mem->dma, mem->len);
13140de09cc2dd Fabien Dessenne 2019-05-14 113 return -ENOMEM;
13140de09cc2dd Fabien Dessenne 2019-05-14 114 }
13140de09cc2dd Fabien Dessenne 2019-05-14 115
13140de09cc2dd Fabien Dessenne 2019-05-14 116 /* Update memory entry va */
13140de09cc2dd Fabien Dessenne 2019-05-14 117 mem->va = va;
13140de09cc2dd Fabien Dessenne 2019-05-14 118
13140de09cc2dd Fabien Dessenne 2019-05-14 119 return 0;
13140de09cc2dd Fabien Dessenne 2019-05-14 120 }
13140de09cc2dd Fabien Dessenne 2019-05-14 121
13140de09cc2dd Fabien Dessenne 2019-05-14 122 static int stm32_rproc_mem_release(struct rproc *rproc,
13140de09cc2dd Fabien Dessenne 2019-05-14 123 struct rproc_mem_entry *mem)
13140de09cc2dd Fabien Dessenne 2019-05-14 124 {
13140de09cc2dd Fabien Dessenne 2019-05-14 125 dev_dbg(rproc->dev.parent, "unmap memory: %pa\n", &mem->dma);
13140de09cc2dd Fabien Dessenne 2019-05-14 @126 iounmap(mem->va);
13140de09cc2dd Fabien Dessenne 2019-05-14 127
13140de09cc2dd Fabien Dessenne 2019-05-14 128 return 0;
13140de09cc2dd Fabien Dessenne 2019-05-14 129 }
13140de09cc2dd Fabien Dessenne 2019-05-14 130

:::::: The code at line 109 was first introduced by commit
:::::: 13140de09cc2dd5e5166ad42292bb82af4e23cef remoteproc: stm32: add an ST stm32_rproc driver

:::::: TO: Fabien Dessenne <fabien.dessenne@xxxxxx>
:::::: CC: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip