drivers/atm/horizon.c:365:9: sparse: sparse: incorrect type in argument 1 (different base types)

From: kernel test robot
Date: Thu Oct 15 2020 - 14:34:39 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3e4fb4346c781068610d03c12b16c0cfb0fd24a3
commit: c1d55d50139bea6bfe964458272a93dd899efb83 asm-generic/io.h: Fix sparse warnings on big-endian architectures
date: 2 months ago
config: xtensa-randconfig-s031-20201015 (attached as .config)
compiler: xtensa-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-rc1-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c1d55d50139bea6bfe964458272a93dd899efb83
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout c1d55d50139bea6bfe964458272a93dd899efb83
# 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=xtensa

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/atm/horizon.c:1135:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *[usertype] tx_addr @@ got void [noderef] __user *iov_base @@
drivers/atm/horizon.c:1135:22: sparse: expected void *[usertype] tx_addr
drivers/atm/horizon.c:1135:22: sparse: got void [noderef] __user *iov_base
drivers/atm/horizon.c:1173:49: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned int [usertype] data @@ got restricted __be32 [usertype] @@
drivers/atm/horizon.c:1173:49: sparse: expected unsigned int [usertype] data
drivers/atm/horizon.c:1173:49: sparse: got restricted __be32 [usertype]
drivers/atm/horizon.c:1177:48: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned int [usertype] data @@ got restricted __be32 [usertype] @@
drivers/atm/horizon.c:1177:48: sparse: expected unsigned int [usertype] data
drivers/atm/horizon.c:1177:48: sparse: got restricted __be32 [usertype]
drivers/atm/horizon.c:369:10: sparse: sparse: cast to restricted __le16
drivers/atm/horizon.c:369:10: sparse: sparse: cast to restricted __le16
drivers/atm/horizon.c:369:10: sparse: sparse: cast to restricted __le16
drivers/atm/horizon.c:369:10: sparse: sparse: cast to restricted __le16
drivers/atm/horizon.c:369:10: sparse: sparse: cast to restricted __le16
drivers/atm/horizon.c:369:10: sparse: sparse: cast to restricted __le16
drivers/atm/horizon.c:369:10: sparse: sparse: cast to restricted __le16
drivers/atm/horizon.c:369:10: sparse: sparse: cast to restricted __le16
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
>> drivers/atm/horizon.c:365:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
>> drivers/atm/horizon.c:365:9: sparse: expected unsigned short [usertype] value
drivers/atm/horizon.c:365:9: sparse: got restricted __le16 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
>> drivers/atm/horizon.c:365:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
>> drivers/atm/horizon.c:365:9: sparse: expected unsigned short [usertype] value
drivers/atm/horizon.c:365:9: sparse: got restricted __le16 [usertype]
>> drivers/atm/horizon.c:365:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
>> drivers/atm/horizon.c:365:9: sparse: expected unsigned short [usertype] value
drivers/atm/horizon.c:365:9: sparse: got restricted __le16 [usertype]
>> drivers/atm/horizon.c:365:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
>> drivers/atm/horizon.c:365:9: sparse: expected unsigned short [usertype] value
drivers/atm/horizon.c:365:9: sparse: got restricted __le16 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
>> drivers/atm/horizon.c:365:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
>> drivers/atm/horizon.c:365:9: sparse: expected unsigned short [usertype] value
drivers/atm/horizon.c:365:9: sparse: got restricted __le16 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
>> drivers/atm/horizon.c:365:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
>> drivers/atm/horizon.c:365:9: sparse: expected unsigned short [usertype] value
drivers/atm/horizon.c:365:9: sparse: got restricted __le16 [usertype]
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:361:10: sparse: sparse: cast to restricted __le32
drivers/atm/horizon.c:357:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
drivers/atm/horizon.c:357:9: sparse: expected unsigned int [usertype] value
drivers/atm/horizon.c:357:9: sparse: got restricted __le32 [usertype]
>> drivers/atm/horizon.c:365:9: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] value @@ got restricted __le16 [usertype] @@
>> drivers/atm/horizon.c:365:9: sparse: expected unsigned short [usertype] value
drivers/atm/horizon.c:365:9: sparse: got restricted __le16 [usertype]
drivers/atm/horizon.c:361:10: sparse: sparse: too many warnings

vim +365 drivers/atm/horizon.c

^1da177e4c3f415 Linus Torvalds 2005-04-16 363
^1da177e4c3f415 Linus Torvalds 2005-04-16 364 static inline void wr_regw (const hrz_dev * dev, unsigned char reg, u16 data) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 @365 outw (cpu_to_le16 (data), dev->iobase + reg);
^1da177e4c3f415 Linus Torvalds 2005-04-16 366 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 367

:::::: The code at line 365 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip