Skip to content

Commit d56d980

Browse files
avri-altman-sndkmartinkpetersen
authored andcommitted
scsi: ufs: Clear ucd_rsp_ptr for UPIU requests once
Previously, the response buffer (ucd_rsp_ptr) was cleared in multiple UPIU preparation functions. Do it once. Signed-off-by: Avri Altman <avri.altman@sandisk.com> Link: https://lore.kernel.org/r/20250617095611.89229-2-avri.altman@sandisk.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 76549ad commit d56d980

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,8 +2826,6 @@ static void ufshcd_prepare_utp_query_req_upiu(struct ufs_hba *hba,
28262826
/* Copy the Descriptor */
28272827
if (query->request.upiu_req.opcode == UPIU_QUERY_OPCODE_WRITE_DESC)
28282828
memcpy(ucd_req_ptr + 1, query->descriptor, len);
2829-
2830-
memset(lrbp->ucd_rsp_ptr, 0, sizeof(struct utp_upiu_rsp));
28312829
}
28322830

28332831
static inline void ufshcd_prepare_utp_nop_upiu(struct ufshcd_lrb *lrbp)
@@ -2840,8 +2838,6 @@ static inline void ufshcd_prepare_utp_nop_upiu(struct ufshcd_lrb *lrbp)
28402838
.transaction_code = UPIU_TRANSACTION_NOP_OUT,
28412839
.task_tag = lrbp->task_tag,
28422840
};
2843-
2844-
memset(lrbp->ucd_rsp_ptr, 0, sizeof(struct utp_upiu_rsp));
28452841
}
28462842

28472843
/**
@@ -2867,6 +2863,8 @@ static int ufshcd_compose_devman_upiu(struct ufs_hba *hba,
28672863
else
28682864
ret = -EINVAL;
28692865

2866+
memset(lrbp->ucd_rsp_ptr, 0, sizeof(struct utp_upiu_rsp));
2867+
28702868
return ret;
28712869
}
28722870

0 commit comments

Comments
 (0)