drivers/firmware/tegra/bpmp-tegra210.c:148:11: sparse: sparse: incorrect type in assignment (different address spaces)

From: kernel test robot
Date: Wed Aug 05 2020 - 03:53:23 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4da9f3302615f4191814f826054846bf843e24fa
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 7 weeks ago
config: arm64-randconfig-s031-20200805 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-117-g8c7aee71-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm64

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/firmware/tegra/bpmp-tegra210.c:148:11: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *p @@ got void [noderef] __iomem * @@
drivers/firmware/tegra/bpmp-tegra210.c:148:11: sparse: expected void *p
>> drivers/firmware/tegra/bpmp-tegra210.c:148:11: sparse: got void [noderef] __iomem *

vim +148 drivers/firmware/tegra/bpmp-tegra210.c

139251fc220830c Timo Alho 2019-01-24 134
139251fc220830c Timo Alho 2019-01-24 135 static int tegra210_bpmp_channel_init(struct tegra_bpmp_channel *channel,
139251fc220830c Timo Alho 2019-01-24 136 struct tegra_bpmp *bpmp,
139251fc220830c Timo Alho 2019-01-24 137 unsigned int index)
139251fc220830c Timo Alho 2019-01-24 138 {
139251fc220830c Timo Alho 2019-01-24 139 struct tegra210_bpmp *priv = bpmp->priv;
139251fc220830c Timo Alho 2019-01-24 140 u32 address;
139251fc220830c Timo Alho 2019-01-24 141 void *p;
139251fc220830c Timo Alho 2019-01-24 142
139251fc220830c Timo Alho 2019-01-24 143 /* Retrieve channel base address from BPMP */
139251fc220830c Timo Alho 2019-01-24 144 writel(index << TRIGGER_ID_SHIFT | TRIGGER_CMD_GET,
139251fc220830c Timo Alho 2019-01-24 145 priv->atomics + TRIGGER_OFFSET);
139251fc220830c Timo Alho 2019-01-24 146 address = readl(priv->atomics + RESULT_OFFSET(index));
139251fc220830c Timo Alho 2019-01-24 147
139251fc220830c Timo Alho 2019-01-24 @148 p = devm_ioremap(bpmp->dev, address, 0x80);
139251fc220830c Timo Alho 2019-01-24 149 if (!p)
139251fc220830c Timo Alho 2019-01-24 150 return -ENOMEM;
139251fc220830c Timo Alho 2019-01-24 151
139251fc220830c Timo Alho 2019-01-24 152 channel->ib = p;
139251fc220830c Timo Alho 2019-01-24 153 channel->ob = p;
139251fc220830c Timo Alho 2019-01-24 154 channel->index = index;
139251fc220830c Timo Alho 2019-01-24 155 init_completion(&channel->completion);
139251fc220830c Timo Alho 2019-01-24 156 channel->bpmp = bpmp;
139251fc220830c Timo Alho 2019-01-24 157
139251fc220830c Timo Alho 2019-01-24 158 return 0;
139251fc220830c Timo Alho 2019-01-24 159 }
139251fc220830c Timo Alho 2019-01-24 160

:::::: The code at line 148 was first introduced by commit
:::::: 139251fc220830cc49b71331d281a8ad03a08ab7 firmware: tegra: add bpmp driver for Tegra210

:::::: TO: Timo Alho <talho@xxxxxxxxxx>
:::::: CC: Thierry Reding <treding@xxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip