mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-26 12:30:23 +09:00
FROMGIT: scsi: ufs: 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(). Change-Id: Ic37b0eda0d59c0b7d759a5d352f139cdcffbf163 Signed-off-by: Bart Van Assche <bvanassche@acm.org> (cherry picked from commit c788cf8a21cd3b12a1823869878e3fd93132859f git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next) Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
committed by
Bart Van Assche
parent
0b5cd2a4a4
commit
67d3336282
@@ -2778,24 +2778,18 @@ static int ufshcd_compose_devman_upiu(struct ufs_hba *hba,
|
||||
* @hba: per adapter instance
|
||||
* @lrbp: pointer to local reference block
|
||||
*/
|
||||
static int ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
|
||||
static void ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
|
||||
{
|
||||
u8 upiu_flags;
|
||||
int ret = 0;
|
||||
|
||||
if (hba->ufs_version <= ufshci_version(1, 1))
|
||||
lrbp->command_type = UTP_CMD_TYPE_SCSI;
|
||||
else
|
||||
lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
|
||||
|
||||
if (likely(lrbp->cmd)) {
|
||||
ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, lrbp->cmd->sc_data_direction, 0);
|
||||
ufshcd_prepare_utp_scsi_cmd_upiu(lrbp, upiu_flags);
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags,
|
||||
lrbp->cmd->sc_data_direction, 0);
|
||||
ufshcd_prepare_utp_scsi_cmd_upiu(lrbp, upiu_flags);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user