Commit fb475b74 authored by Avri Altman's avatar Avri Altman Committed by Martin K. Petersen

scsi: ufs: A tad optimization in query upiu trace

Remove a redundant if clause in ufshcd_add_query_upiu_trace.

Link: https://lore.kernel.org/r/20210110084618.189371-1-avri.altman@wdc.comReviewed-by: default avatarBean Huo <beanhuo@micron.com>
Signed-off-by: default avatarAvri Altman <avri.altman@wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 6b1dba3d
...@@ -317,19 +317,13 @@ static void ufshcd_add_cmd_upiu_trace(struct ufs_hba *hba, unsigned int tag, ...@@ -317,19 +317,13 @@ static void ufshcd_add_cmd_upiu_trace(struct ufs_hba *hba, unsigned int tag,
UFS_TSF_CDB); UFS_TSF_CDB);
} }
static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba, unsigned int tag, static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba,
enum ufs_trace_str_t str_t) enum ufs_trace_str_t str_t,
struct utp_upiu_req *rq_rsp)
{ {
struct utp_upiu_req *rq_rsp;
if (!trace_ufshcd_upiu_enabled()) if (!trace_ufshcd_upiu_enabled())
return; return;
if (str_t == UFS_QUERY_SEND)
rq_rsp = hba->lrb[tag].ucd_req_ptr;
else
rq_rsp = (struct utp_upiu_req *)hba->lrb[tag].ucd_rsp_ptr;
trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq_rsp->header, trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq_rsp->header,
&rq_rsp->qr, UFS_TSF_OSF); &rq_rsp->qr, UFS_TSF_OSF);
} }
...@@ -2877,7 +2871,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, ...@@ -2877,7 +2871,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
hba->dev_cmd.complete = &wait; hba->dev_cmd.complete = &wait;
ufshcd_add_query_upiu_trace(hba, tag, UFS_QUERY_SEND); ufshcd_add_query_upiu_trace(hba, UFS_QUERY_SEND, lrbp->ucd_req_ptr);
/* Make sure descriptors are ready before ringing the doorbell */ /* Make sure descriptors are ready before ringing the doorbell */
wmb(); wmb();
spin_lock_irqsave(hba->host->host_lock, flags); spin_lock_irqsave(hba->host->host_lock, flags);
...@@ -2887,8 +2881,8 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, ...@@ -2887,8 +2881,8 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
err = ufshcd_wait_for_dev_cmd(hba, lrbp, timeout); err = ufshcd_wait_for_dev_cmd(hba, lrbp, timeout);
out: out:
ufshcd_add_query_upiu_trace(hba, tag, ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP,
err ? UFS_QUERY_ERR : UFS_QUERY_COMP); (struct utp_upiu_req *)lrbp->ucd_rsp_ptr);
out_put_tag: out_put_tag:
blk_put_request(req); blk_put_request(req);
......
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