drivers/rpmsg/qcom_glink_smem.c:93:17: sparse: sparse: incorrect type in argument 2 (different address spaces)

From: kernel test robot
Date: Wed Dec 13 2023 - 18:14:18 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5bd7ef53ffe5ca580e93e74eb8c81ed191ddc4bd
commit: 928002a5e9dab2ddc1a0fe3e00739e89be30dc6b rpmsg: glink: smem: Support rx peak for size less than 4 bytes
date: 5 years ago
config: arm-randconfig-r131-20231117 (https://download.01.org/0day-ci/archive/20231214/202312140746.AMlosG0F-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231214/202312140746.AMlosG0F-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312140746.AMlosG0F-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/rpmsg/qcom_glink_smem.c:93:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *from @@ got void * @@
drivers/rpmsg/qcom_glink_smem.c:93:17: sparse: expected void const volatile [noderef] __iomem *from
drivers/rpmsg/qcom_glink_smem.c:93:17: sparse: got void *
>> drivers/rpmsg/qcom_glink_smem.c:96:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *from @@ got void *fifo @@
drivers/rpmsg/qcom_glink_smem.c:96:17: sparse: expected void const volatile [noderef] __iomem *from
drivers/rpmsg/qcom_glink_smem.c:96:17: sparse: got void *fifo

vim +93 drivers/rpmsg/qcom_glink_smem.c

78
79 static void glink_smem_rx_peak(struct qcom_glink_pipe *np,
80 void *data, unsigned int offset, size_t count)
81 {
82 struct glink_smem_pipe *pipe = to_smem_pipe(np);
83 size_t len;
84 u32 tail;
85
86 tail = le32_to_cpu(*pipe->tail);
87 tail += offset;
88 if (tail >= pipe->native.length)
89 tail -= pipe->native.length;
90
91 len = min_t(size_t, count, pipe->native.length - tail);
92 if (len)
> 93 memcpy_fromio(data, pipe->fifo + tail, len);
94
95 if (len != count)
> 96 memcpy_fromio(data + len, pipe->fifo, (count - len));
97 }
98

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki