[mkp-scsi:for-next 147/148] drivers/scsi/ufs/ufshpb.c:335:27: sparse: sparse: cast from restricted __be64
From: kernel test robot
Date: Fri Aug 06 2021 - 13:00:34 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
head: f5efd4fe78de871515444b660029074be17ec11f
commit: 63522bf3aced0a782b59f0314dbad5cdc8b14c59 [147/148] scsi: ufs: core: Add L2P entry swap quirk for Micron UFS
config: microblaze-randconfig-s032-20210805 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 10.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-348-gf0e6938b-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git/commit/?id=63522bf3aced0a782b59f0314dbad5cdc8b14c59
git remote add mkp-scsi https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
git fetch --no-tags mkp-scsi for-next
git checkout 63522bf3aced0a782b59f0314dbad5cdc8b14c59
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/scsi/ufs/
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/scsi/ufs/ufshpb.c:335:27: sparse: sparse: cast from restricted __be64
>> drivers/scsi/ufs/ufshpb.c:335:27: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] val @@ got restricted __be64 [usertype] ppn @@
drivers/scsi/ufs/ufshpb.c:335:27: sparse: expected unsigned long long [usertype] val
drivers/scsi/ufs/ufshpb.c:335:27: sparse: got restricted __be64 [usertype] ppn
>> drivers/scsi/ufs/ufshpb.c:335:27: sparse: sparse: cast from restricted __be64
>> drivers/scsi/ufs/ufshpb.c:335:27: sparse: sparse: cast from restricted __be64
>> drivers/scsi/ufs/ufshpb.c:335:27: sparse: sparse: cast from restricted __be64
>> drivers/scsi/ufs/ufshpb.c:335:27: sparse: sparse: cast from restricted __be64
>> drivers/scsi/ufs/ufshpb.c:335:27: sparse: sparse: cast from restricted __be64
>> drivers/scsi/ufs/ufshpb.c:335:27: sparse: sparse: cast from restricted __be64
>> drivers/scsi/ufs/ufshpb.c:335:27: sparse: sparse: cast from restricted __be64
>> drivers/scsi/ufs/ufshpb.c:335:27: sparse: sparse: cast from restricted __be64
>> drivers/scsi/ufs/ufshpb.c:335:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be64 [usertype] ppn_tmp @@ got unsigned long long @@
drivers/scsi/ufs/ufshpb.c:335:25: sparse: expected restricted __be64 [usertype] ppn_tmp
drivers/scsi/ufs/ufshpb.c:335:25: sparse: got unsigned long long
vim +335 drivers/scsi/ufs/ufshpb.c
324
325 static void
326 ufshpb_set_hpb_read_to_upiu(struct ufs_hba *hba, struct ufshpb_lu *hpb,
327 struct ufshcd_lrb *lrbp, u32 lpn, __be64 ppn,
328 u8 transfer_len, int read_id)
329 {
330 unsigned char *cdb = lrbp->cmd->cmnd;
331 __be64 ppn_tmp = ppn;
332 cdb[0] = UFSHPB_READ;
333
334 if (hba->dev_quirks & UFS_DEVICE_QUIRK_SWAP_L2P_ENTRY_FOR_HPB_READ)
> 335 ppn_tmp = swab64(ppn);
336
337 /* ppn value is stored as big-endian in the host memory */
338 memcpy(&cdb[6], &ppn_tmp, sizeof(__be64));
339 cdb[14] = transfer_len;
340 cdb[15] = read_id;
341
342 lrbp->cmd->cmd_len = UFS_CDB_SIZE;
343 }
344
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip