Skip to content

Commit c788cf8

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: ufs: core: Simplify ufshcd_comp_scsi_upiu()
ufshcd_comp_scsi_upiu() has one caller and that caller ensures that lrbp->cmd != NULL. Hence leave out the lrbp->cmd check from ufshcd_comp_scsi_upiu(). Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230921192335.676924-4-bvanassche@acm.org Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 858231b commit c788cf8

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,27 +2714,19 @@ static int ufshcd_compose_devman_upiu(struct ufs_hba *hba,
27142714
* for SCSI Purposes
27152715
* @hba: per adapter instance
27162716
* @lrbp: pointer to local reference block
2717-
*
2718-
* Return: 0 upon success; < 0 upon failure.
27192717
*/
2720-
static int ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
2718+
static void ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
27212719
{
27222720
u8 upiu_flags;
2723-
int ret = 0;
27242721

27252722
if (hba->ufs_version <= ufshci_version(1, 1))
27262723
lrbp->command_type = UTP_CMD_TYPE_SCSI;
27272724
else
27282725
lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
27292726

2730-
if (likely(lrbp->cmd)) {
2731-
ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, lrbp->cmd->sc_data_direction, 0);
2732-
ufshcd_prepare_utp_scsi_cmd_upiu(lrbp, upiu_flags);
2733-
} else {
2734-
ret = -EINVAL;
2735-
}
2736-
2737-
return ret;
2727+
ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags,
2728+
lrbp->cmd->sc_data_direction, 0);
2729+
ufshcd_prepare_utp_scsi_cmd_upiu(lrbp, upiu_flags);
27382730
}
27392731

27402732
/**

0 commit comments

Comments
 (0)