drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:306:26: sparse: sparse: incorrect type in argument 1 (different address spaces)

From: kernel test robot
Date: Sat Sep 05 2020 - 14:55:53 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c70672d8d316ebd46ea447effadfe57ab7a30a50
commit: 8f28ca6bd8211214faf717677bbffe375c2a6072 iomap: constify ioreadX() iomem argument (as in generic implementation)
date: 3 weeks ago
config: i386-randconfig-s002-20200906 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-191-g10164920-dirty
git checkout 8f28ca6bd8211214faf717677bbffe375c2a6072
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386

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/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2135:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2135:41: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2135:41: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:33: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned short [usertype] uid_hi @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:33: sparse: expected unsigned short [usertype] uid_hi
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:33: sparse: got restricted __be16 [usertype]
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:45: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned int [usertype] uid_lo @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:45: sparse: expected unsigned int [usertype] uid_lo
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:45: sparse: got restricted __be32 [usertype]
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:56: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected unsigned short [usertype] seqid @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:56: sparse: expected unsigned short [usertype] seqid
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:56: sparse: got restricted __be16 [usertype]
>> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:306:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem * @@ got void *reg @@
>> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:306:26: sparse: expected void const [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:306:26: sparse: got void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:336:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:336:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:336:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:343:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:343:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:343:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:356:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:356:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:356:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:397:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:397:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:397:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:466:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:466:41: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:466:41: sparse: got unsigned int [noderef] __iomem *

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8f28ca6bd8211214faf717677bbffe375c2a6072
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 8f28ca6bd8211214faf717677bbffe375c2a6072
vim +306 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c

77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 294
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 295 /**
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 296 * pch_gbe_wait_clr_bit - Wait to clear a bit
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 297 * @reg: Pointer of register
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 298 * @busy: Busy bit
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 299 */
191cc687740834 drivers/net/pch_gbe/pch_gbe_main.c stephen hemminger 2010-10-15 300 static void pch_gbe_wait_clr_bit(void *reg, u32 bit)
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 301 {
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 302 u32 tmp;
453ca931f51516 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Andy Shevchenko 2013-06-28 303
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 304 /* wait busy */
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 305 tmp = 1000;
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 @306 while ((ioread32(reg) & bit) && --tmp)
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 307 cpu_relax();
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 308 if (!tmp)
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 309 pr_err("Error: busy bit is not cleared\n");
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 310 }
124d770a6459be drivers/net/pch_gbe/pch_gbe_main.c Toshiharu Okada 2011-09-01 311

:::::: The code at line 306 was first introduced by commit
:::::: 77555ee7228234257957fd54daa0b69178906320 net: Add Gigabit Ethernet driver of Topcliff PCH

:::::: TO: Masayuki Ohtake <masa-korg@xxxxxxxxxxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip