drivers/soc/aspeed/aspeed-socinfo.c:80:17: sparse: sparse: incorrect type in argument 1 (different address spaces)

From: kernel test robot
Date: Sat Dec 26 2020 - 23:35:09 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f838f8d2b694cf9d524dc4423e9dd2db13892f3f
commit: e0218dca5787c851b403fcbc33cdfec795446fca soc: aspeed: Add soc info driver
date: 3 months ago
config: openrisc-randconfig-s032-20201221 (attached as .config)
compiler: or1k-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.3-184-g1b896707-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e0218dca5787c851b403fcbc33cdfec795446fca
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e0218dca5787c851b403fcbc33cdfec795446fca
# 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=openrisc

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/soc/aspeed/aspeed-socinfo.c:80:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got void [noderef] __iomem *[assigned] reg @@
drivers/soc/aspeed/aspeed-socinfo.c:80:17: sparse: expected void *addr
drivers/soc/aspeed/aspeed-socinfo.c:80:17: sparse: got void [noderef] __iomem *[assigned] reg
drivers/soc/aspeed/aspeed-socinfo.c:88:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got void [noderef] __iomem *[assigned] reg @@
drivers/soc/aspeed/aspeed-socinfo.c:88:25: sparse: expected void *addr
drivers/soc/aspeed/aspeed-socinfo.c:88:25: sparse: got void [noderef] __iomem *[assigned] reg

vim +80 drivers/soc/aspeed/aspeed-socinfo.c

58
59 static int __init aspeed_socinfo_init(void)
60 {
61 struct soc_device_attribute *attrs;
62 struct soc_device *soc_dev;
63 struct device_node *np;
64 void __iomem *reg;
65 bool has_chipid = false;
66 u32 siliconid;
67 u32 chipid[2];
68 const char *machine = NULL;
69
70 np = of_find_compatible_node(NULL, NULL, "aspeed,silicon-id");
71 if (!of_device_is_available(np)) {
72 of_node_put(np);
73 return -ENODEV;
74 }
75
76 reg = of_iomap(np, 0);
77 if (!reg)
78 return -ENODEV;
79 siliconid = readl(reg);
> 80 iounmap(reg);

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

Attachment: .config.gz
Description: application/gzip