scsi: ufs: ufshpb: Fix sparse warning in ufshpb_set_hpb_read_to_upiu()
PATCH 1/1 scsi: ufs: ufshpb: Fix sparse warning in ufshpb_set_hpb_read_to_upiu()
From: Bean Huo <[email protected]>
This patch is to fix the following sparse warnings in ufshpb_set_hpb_read_to_upiu():
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:25: sparse: expected restricted __be64 [usertype] ppn_tmp drivers/scsi/ufs/ufshpb.c:335:25: sparse: got unsigned long long [usertype]
--- drivers/scsi/ufs/ufshpb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufshpb.c +1 -1
@@ -331,7 +331,7 @@ ufshpb_set_hpb_read_to_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, cdb[0 ] =UFSHPB_READ ;if (hba->dev_quirks &UFS_DEVICE_QUIRK_SWAP_L2P_ENTRY_FOR_HPB_READ ) - ppn_tmp =swab64 (ppn); + ppn_tmp = (__force __be64 )swab64 ((__force u64 )ppn);/* ppn value is stored as big-endian in the host memory */ memcpy (&cdb[6 ], &ppn_tmp,sizeof (__be64));
Signature · 1 line
2.25.1
drivers/scsi/ufs/ufshpb.c ufshpb_set_hpb_read_to_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, · line 334
Quoted 2 lines · Bean Huo
drivers/scsi/ufs/ufshpb.c +1
-1- ppn_tmp =swab64 (ppn); + ppn_tmp = (__force __be64 )swab64 ((__force u64 )ppn);
Martin K. Petersen
AppliedQuoted 10 lines · Bean Huo
From: Bean Huo <[email protected]>
This patch is to fix the following sparse warnings in
ufshpb_set_hpb_read_to_upiu():sparse warnings: (new ones prefixed by >>)
drivers/scsi/ufs/ufshpb.c:335:27: sparse: sparse: cast from restricted__be64drivers/scsi/ufs/ufshpb.c:335:25: sparse: expected restricted__be64[usertype]ppn_tmpdrivers/scsi/ufs/ufshpb.c:335:25: sparse: got unsigned long long [usertype][...]
Applied to 5.16/scsi-fixes, thanks!
[1/1] scsi: ufs: ufshpb: Fix sparse warning in ufshpb_set_hpb_read_to_upiu()
https://git.kernel.org/mkp/scsi/c/73185a13773a
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering