Commit 2f269150 authored by Bart Van Assche's avatar Bart Van Assche Committed by Greg Kroah-Hartman

scsi: ufs: Make ufshcd_add_command_trace() easier to read

[ Upstream commit e4d2add7 ]

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-3-bvanassche@acm.orgReviewed-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Reviewed-by: default avatarCan Guo <cang@codeaurora.org>
Reviewed-by: default avatarAlim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4913d773
...@@ -353,27 +353,27 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, ...@@ -353,27 +353,27 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba,
u8 opcode = 0; u8 opcode = 0;
u32 intr, doorbell; u32 intr, doorbell;
struct ufshcd_lrb *lrbp = &hba->lrb[tag]; struct ufshcd_lrb *lrbp = &hba->lrb[tag];
struct scsi_cmnd *cmd = lrbp->cmd;
int transfer_len = -1; int transfer_len = -1;
if (!trace_ufshcd_command_enabled()) { if (!trace_ufshcd_command_enabled()) {
/* trace UPIU W/O tracing command */ /* trace UPIU W/O tracing command */
if (lrbp->cmd) if (cmd)
ufshcd_add_cmd_upiu_trace(hba, tag, str); ufshcd_add_cmd_upiu_trace(hba, tag, str);
return; return;
} }
if (lrbp->cmd) { /* data phase exists */ if (cmd) { /* data phase exists */
/* trace UPIU also */ /* trace UPIU also */
ufshcd_add_cmd_upiu_trace(hba, tag, str); ufshcd_add_cmd_upiu_trace(hba, tag, str);
opcode = (u8)(*lrbp->cmd->cmnd); opcode = cmd->cmnd[0];
if ((opcode == READ_10) || (opcode == WRITE_10)) { if ((opcode == READ_10) || (opcode == WRITE_10)) {
/* /*
* Currently we only fully trace read(10) and write(10) * Currently we only fully trace read(10) and write(10)
* commands * commands
*/ */
if (lrbp->cmd->request && lrbp->cmd->request->bio) if (cmd->request && cmd->request->bio)
lba = lba = cmd->request->bio->bi_iter.bi_sector;
lrbp->cmd->request->bio->bi_iter.bi_sector;
transfer_len = be32_to_cpu( transfer_len = be32_to_cpu(
lrbp->ucd_req_ptr->sc.exp_data_transfer_len); lrbp->ucd_req_ptr->sc.exp_data_transfer_len);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment