arch/powerpc/platforms/44x/ppc476.c:241:34: sparse: sparse: incorrect type in argument 1 (different address spaces)
From: kernel test robot
Date: Tue Sep 14 2021 - 19:22:37 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3ca706c189db861b2ca2019a0901b94050ca49d8
commit: 894fa235eb4ca0bfa692dbe4932c2f940cdc8c1e powerpc: inline iomap accessors
date: 10 months ago
config: powerpc-randconfig-s031-20210915 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 11.2.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.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=894fa235eb4ca0bfa692dbe4932c2f940cdc8c1e
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 894fa235eb4ca0bfa692dbe4932c2f940cdc8c1e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
arch/powerpc/platforms/44x/ppc476.c:236:17: sparse: sparse: cast removes address space '__iomem' of expression
>> arch/powerpc/platforms/44x/ppc476.c:241:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got unsigned char [usertype] * @@
arch/powerpc/platforms/44x/ppc476.c:241:34: sparse: expected void const volatile [noderef] __iomem *addr
arch/powerpc/platforms/44x/ppc476.c:241:34: sparse: got unsigned char [usertype] *
arch/powerpc/platforms/44x/ppc476.c:243:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned char [usertype] *[assigned] fpga @@
arch/powerpc/platforms/44x/ppc476.c:243:17: sparse: expected void volatile [noderef] __iomem *addr
arch/powerpc/platforms/44x/ppc476.c:243:17: sparse: got unsigned char [usertype] *[assigned] fpga
vim +241 arch/powerpc/platforms/44x/ppc476.c
228d55053397e6 arch/powerpc/platforms/44x/currituck.c Tony Breeds 2011-11-30 217
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 218 static int board_rev = -1;
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 219 static int __init ppc47x_get_board_rev(void)
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 220 {
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 221 int reg;
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 222 u8 *fpga;
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 223 struct device_node *np = NULL;
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 224
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 225 if (of_machine_is_compatible("ibm,currituck")) {
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 226 np = of_find_compatible_node(NULL, NULL, "ibm,currituck-fpga");
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 227 reg = 0;
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 228 } else if (of_machine_is_compatible("ibm,akebono")) {
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 229 np = of_find_compatible_node(NULL, NULL, "ibm,akebono-fpga");
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 230 reg = 2;
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 231 }
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 232
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 233 if (!np)
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 234 goto fail;
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 235
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 @236 fpga = (u8 *) of_iomap(np, 0);
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 237 of_node_put(np);
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 238 if (!fpga)
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 239 goto fail;
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 240
2a2c74b2efcb1a arch/powerpc/platforms/44x/ppc476.c Alistair Popple 2014-03-06 @241 board_rev = ioread8(fpga + reg) & 0x03;
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 242 pr_info("%s: Found board revision %d\n", __func__, board_rev);
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 243 iounmap(fpga);
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 244 return 0;
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 245
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 246 fail:
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 247 pr_info("%s: Unable to find board revision\n", __func__);
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 248 return 0;
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 249 }
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 250 machine_arch_initcall(ppc47x, ppc47x_get_board_rev);
ab9a4183fddf23 arch/powerpc/platforms/44x/currituck.c Alistair Popple 2013-05-09 251
:::::: The code at line 241 was first introduced by commit
:::::: 2a2c74b2efcb1a0ca3fdcb5fbb96ad8de6a29177 IBM Akebono: Add the Akebono platform
:::::: TO: Alistair Popple <alistair@xxxxxxxxxxxx>
:::::: CC: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip