[mgr:v5.19/topic/rk3568-vepu-h264-stateless-bootlin 3/4] drivers/staging/media/hantro/hantro_h264.c:1254:27: sparse: sparse: incorrect type in assignment (different base types)

From: kernel test robot
Date: Tue Jun 21 2022 - 20:19:36 EST


tree: https://git.pengutronix.de/git/mgr/linux v5.19/topic/rk3568-vepu-h264-stateless-bootlin
head: 11fcd09bf7cbe84c3e2e322142e3aff59c5c8402
commit: a373f546c23855d80f8a6be85fc11748ed54413d [3/4] media: hantro: Add H.264 encoding support
config: riscv-randconfig-s031-20220619 (https://download.01.org/0day-ci/archive/20220622/202206220835.2xwbmnW9-lkp@xxxxxxxxx/config)
compiler: riscv32-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-31-g4880bd19-dirty
git remote add mgr https://git.pengutronix.de/git/mgr/linux
git fetch --no-tags mgr v5.19/topic/rk3568-vepu-h264-stateless-bootlin
git checkout a373f546c23855d80f8a6be85fc11748ed54413d
# 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=riscv SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> drivers/staging/media/hantro/hantro_h264.c:1254:27: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] @@ got restricted __be64 [usertype] @@
drivers/staging/media/hantro/hantro_h264.c:1254:27: sparse: expected unsigned long long [usertype]
drivers/staging/media/hantro/hantro_h264.c:1254:27: sparse: got restricted __be64 [usertype]

vim +1254 drivers/staging/media/hantro/hantro_h264.c

1214
1215 static void cabac_table_init(struct hantro_aux_buf *cabac_table,
1216 u32 cabac_init_idc)
1217 {
1218 u8 *table = cabac_table->cpu;
1219 u64 *buffer = cabac_table->cpu;
1220 unsigned int i, j;
1221 unsigned int size;
1222 s32 qp;
1223
1224 /* Iterate possible QP values. */
1225 for (qp = 0; qp < 52; qp++) {
1226 /* Iterate intra/inter modes. */
1227 for (j = 0; j < 2; j++) {
1228 const s32 (*context)[460][2];
1229
1230 if (j == 0)
1231 context = &h264_context_init_intra;
1232 else
1233 context = &h264_context_init[cabac_init_idc];
1234
1235 for (i = 0; i < 460; i++) {
1236 s32 m = (s32)(*context)[i][0];
1237 s32 n = (s32)(*context)[i][1];
1238
1239 s32 pre_ctx_st = CLIP3(((m * qp) >> 4) + n,
1240 1, 126);
1241 u32 idx = qp * 464 * 2 + j * 464 + i;
1242
1243 if (pre_ctx_st <= 63)
1244 table[idx] = (u8)((63 - pre_ctx_st) << 1);
1245 else
1246 table[idx] = (u8)(((pre_ctx_st - 64) << 1) | 1);
1247 }
1248 }
1249 }
1250
1251 size = HANTRO_H264_ENC_CABAC_TABLE_SIZE / sizeof(*buffer);
1252
1253 for (i = 0; i < size; i++)
> 1254 buffer[i] = cpu_to_be64(buffer[i]);
1255 }
1256

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