mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 11:33:28 +02:00
scsi: ufs: Make ufshcd_prepare_utp_scsi_cmd_upiu() easier to read
Since the lrbp->cmd expression occurs multiple times, introduce a new local variable to hold that pointer. This patch does not change any functionality. Cc: Bean Huo <beanhuo@micron.com> Cc: Can Guo <cang@codeaurora.org> Cc: Avri Altman <avri.altman@wdc.com> Cc: Stanley Chu <stanley.chu@mediatek.com> Cc: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20191224220248.30138-4-bvanassche@acm.org Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Reviewed-by: Can Guo <cang@codeaurora.org> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
e4d2add7fd
commit
1b21b8f008
|
|
@ -2218,6 +2218,7 @@ static void ufshcd_prepare_req_desc_hdr(struct ufshcd_lrb *lrbp,
|
|||
static
|
||||
void ufshcd_prepare_utp_scsi_cmd_upiu(struct ufshcd_lrb *lrbp, u32 upiu_flags)
|
||||
{
|
||||
struct scsi_cmnd *cmd = lrbp->cmd;
|
||||
struct utp_upiu_req *ucd_req_ptr = lrbp->ucd_req_ptr;
|
||||
unsigned short cdb_len;
|
||||
|
||||
|
|
@ -2231,12 +2232,11 @@ void ufshcd_prepare_utp_scsi_cmd_upiu(struct ufshcd_lrb *lrbp, u32 upiu_flags)
|
|||
/* Total EHS length and Data segment length will be zero */
|
||||
ucd_req_ptr->header.dword_2 = 0;
|
||||
|
||||
ucd_req_ptr->sc.exp_data_transfer_len =
|
||||
cpu_to_be32(lrbp->cmd->sdb.length);
|
||||
ucd_req_ptr->sc.exp_data_transfer_len = cpu_to_be32(cmd->sdb.length);
|
||||
|
||||
cdb_len = min_t(unsigned short, lrbp->cmd->cmd_len, UFS_CDB_SIZE);
|
||||
cdb_len = min_t(unsigned short, cmd->cmd_len, UFS_CDB_SIZE);
|
||||
memset(ucd_req_ptr->sc.cdb, 0, UFS_CDB_SIZE);
|
||||
memcpy(ucd_req_ptr->sc.cdb, lrbp->cmd->cmnd, cdb_len);
|
||||
memcpy(ucd_req_ptr->sc.cdb, cmd->cmnd, cdb_len);
|
||||
|
||||
memset(lrbp->ucd_rsp_ptr, 0, sizeof(struct utp_upiu_rsp));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user