drivers/base/regmap/regmap-raw-ram.c:24:24: sparse: sparse: cast to restricted __be16

From: kernel test robot
Date: Wed Jan 10 2024 - 06:11:24 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ab27740f76654ed58dd32ac0ba0031c18a6dea3b
commit: 65dd2f671875b1d97b6fa9bcf7677f5e1c55f776 regmap: Provide a ram backed regmap with raw support
date: 7 months ago
config: x86_64-randconfig-123-20240106 (https://download.01.org/0day-ci/archive/20240110/202401101945.4P5qaf35-lkp@xxxxxxxxx/config)
compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240110/202401101945.4P5qaf35-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401101945.4P5qaf35-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/base/regmap/regmap-raw-ram.c:24:24: sparse: sparse: cast to restricted __be16
>> drivers/base/regmap/regmap-raw-ram.c:26:24: sparse: sparse: cast to restricted __le16

vim +24 drivers/base/regmap/regmap-raw-ram.c

18
19 static unsigned int decode_reg(enum regmap_endian endian, const void *reg)
20 {
21 const u16 *r = reg;
22
23 if (endian == REGMAP_ENDIAN_BIG)
> 24 return be16_to_cpu(*r);
25 else
> 26 return le16_to_cpu(*r);
27 }
28

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki