include/asm-generic/io.h:291:22: sparse: sparse: incorrect type in argument 1 (different base types)

From: kernel test robot
Date: Tue Nov 23 2021 - 08:40:44 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 136057256686de39cc3a07c2e39ef6bc43003ff6
commit: 6e1e90ec027509a7e8d4efbd77a65b32b5a8b3ec regmap: mmio: add config option to allow relaxed MMIO accesses
date: 1 year, 1 month ago
config: h8300-randconfig-s031-20211117 (https://download.01.org/0day-ci/archive/20211123/202111232102.j4IfMUMj-lkp@xxxxxxxxx/config.gz)
compiler: h8300-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=6e1e90ec027509a7e8d4efbd77a65b32b5a8b3ec
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 6e1e90ec027509a7e8d4efbd77a65b32b5a8b3ec
# save the config file 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=h8300

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/base/regmap/regmap-mmio.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:32:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:32:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:38:11: sparse: sparse: cast removes address space '__iomem' of expression
drivers/base/regmap/regmap-mmio.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
>> include/asm-generic/io.h:291:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] b @@ got restricted __le16 [usertype] @@
include/asm-generic/io.h:291:22: sparse: expected unsigned short [usertype] b
include/asm-generic/io.h:291:22: sparse: got restricted __le16 [usertype]
drivers/base/regmap/regmap-mmio.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:38:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:38:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
drivers/base/regmap/regmap-mmio.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] b @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] b
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
drivers/base/regmap/regmap-mmio.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:44:11: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:14:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:14:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
drivers/base/regmap/regmap-mmio.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:259:16: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:259:16: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:259:16: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:259:16: sparse: sparse: cast to restricted __le16
drivers/base/regmap/regmap-mmio.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:20:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
drivers/base/regmap/regmap-mmio.c: note: in included file (through arch/h8300/include/asm/io.h, include/linux/io.h):
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
drivers/base/regmap/regmap-mmio.c: note: in included file (through include/linux/io.h):
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression
arch/h8300/include/asm/io.h:26:18: sparse: sparse: cast removes address space '__iomem' of expression

vim +291 include/asm-generic/io.h

9439eb3ab9d1ec Will Deacon 2013-09-03 286
9439eb3ab9d1ec Will Deacon 2013-09-03 287 #ifndef writew_relaxed
a71e7c44ffb7ba Sinan Kaya 2018-04-06 288 #define writew_relaxed writew_relaxed
a71e7c44ffb7ba Sinan Kaya 2018-04-06 289 static inline void writew_relaxed(u16 value, volatile void __iomem *addr)
a71e7c44ffb7ba Sinan Kaya 2018-04-06 290 {
a71e7c44ffb7ba Sinan Kaya 2018-04-06 @291 __raw_writew(cpu_to_le16(value), addr);
a71e7c44ffb7ba Sinan Kaya 2018-04-06 292 }
9439eb3ab9d1ec Will Deacon 2013-09-03 293 #endif
9439eb3ab9d1ec Will Deacon 2013-09-03 294

:::::: The code at line 291 was first introduced by commit
:::::: a71e7c44ffb7baea0c0795824afc34cc0bc1a301 io: change writeX_relaxed() to remove barriers

:::::: TO: Sinan Kaya <okaya@xxxxxxxxxxxxxx>
:::::: CC: Arnd Bergmann <arnd@xxxxxxxx>

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