arch/powerpc/platforms/powernv/opal-fadump.h:138:25: sparse: sparse: cast from restricted __be64

From: kernel test robot
Date: Tue Jun 14 2022 - 11:04:33 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b13baccc3850ca8b8cccbf8ed9912dbaa0fdf7f3
commit: b74196af372f7cb4902179009265fe63ac81824f powerpc/fadump: Fix fadump to work with a different endian capture kernel
date: 7 weeks ago
config: powerpc64-randconfig-s032-20220613 (https://download.01.org/0day-ci/archive/20220614/202206142217.Y5HsfbXB-lkp@xxxxxxxxx/config)
compiler: powerpc64le-linux-gcc (GCC) 11.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.4-30-g92122700-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b74196af372f7cb4902179009265fe63ac81824f
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout b74196af372f7cb4902179009265fe63ac81824f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash arch/powerpc/kvm/ arch/powerpc/platforms/powernv/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
arch/powerpc/platforms/powernv/opal-fadump.c: note: in included file:
>> arch/powerpc/platforms/powernv/opal-fadump.h:138:25: sparse: sparse: cast from restricted __be64

vim +138 arch/powerpc/platforms/powernv/opal-fadump.h

123
124 static inline void opal_fadump_read_regs(char *bufp, unsigned int regs_cnt,
125 unsigned int reg_entry_size,
126 bool cpu_endian,
127 struct pt_regs *regs)
128 {
129 struct hdat_fadump_reg_entry *reg_entry;
130 u64 val;
131 int i;
132
133 memset(regs, 0, sizeof(struct pt_regs));
134
135 for (i = 0; i < regs_cnt; i++, bufp += reg_entry_size) {
136 reg_entry = (struct hdat_fadump_reg_entry *)bufp;
137 val = (cpu_endian ? be64_to_cpu(reg_entry->reg_val) :
> 138 (u64)(reg_entry->reg_val));
139 opal_fadump_set_regval_regnum(regs,
140 be32_to_cpu(reg_entry->reg_type),
141 be32_to_cpu(reg_entry->reg_num),
142 val);
143 }
144 }
145

--
0-DAY CI Kernel Test Service
https://01.org/lkp