include/asm-generic/io.h:259:16: sparse: sparse: cast to restricted __le16

From: kernel test robot
Date: Fri Nov 19 2021 - 15:53:29 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4c388a8e740d3235a194f330c8ef327deef710f6
commit: 6e1e90ec027509a7e8d4efbd77a65b32b5a8b3ec regmap: mmio: add config option to allow relaxed MMIO accesses
date: 1 year, 1 month ago
config: ia64-randconfig-s032-20211116 (attached as .config)
compiler: ia64-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 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__' O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/base/regmap/ drivers/net/ethernet/stmicro/stmmac/ kernel/bpf/ lib/

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 arch/ia64/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] value @@ got restricted __le16 [usertype] @@
include/asm-generic/io.h:291:22: sparse: expected unsigned short [usertype] value
include/asm-generic/io.h:291:22: sparse: got restricted __le16 [usertype]
include/asm-generic/io.h:299:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:299:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:299:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:236:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:236:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:236:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:307:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:307:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:307:22: sparse: got restricted __le64 [usertype]
>> include/asm-generic/io.h:259:16: sparse: sparse: cast to restricted __le16
include/asm-generic/io.h:267:16: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:193:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:275:16: sparse: sparse: cast to restricted __le64

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

1c8d29696f0d79 Arnd Bergmann 2014-11-11 254
1c8d29696f0d79 Arnd Bergmann 2014-11-11 255 #ifndef readw_relaxed
8875c55437617f Sinan Kaya 2018-04-06 256 #define readw_relaxed readw_relaxed
8875c55437617f Sinan Kaya 2018-04-06 257 static inline u16 readw_relaxed(const volatile void __iomem *addr)
8875c55437617f Sinan Kaya 2018-04-06 258 {
8875c55437617f Sinan Kaya 2018-04-06 @259 return __le16_to_cpu(__raw_readw(addr));
8875c55437617f Sinan Kaya 2018-04-06 260 }
1c8d29696f0d79 Arnd Bergmann 2014-11-11 261 #endif
1c8d29696f0d79 Arnd Bergmann 2014-11-11 262

:::::: The code at line 259 was first introduced by commit
:::::: 8875c55437617fa4351070656bd78e17ed8284a5 io: change readX_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

Attachment: .config.gz
Description: application/gzip