On 4/1/22 12:21, Avri Altman wrote:
ufshcd_lrb.sense_buffer is NULL if ufshcd_lrb.cmd is NULL and
ufshcd_lrb.sense_buffer points at cmd->sense_buffer if ufshcd_lrb.cmd
is set. In other words, the ufshcd_lrb.sense_buffer member is identical
to cmd->sense_buffer. Hence this patch that removes the
ufshcd_lrb.sense_buffer structure member.
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
drivers/scsi/ufs/ufshcd.c | 9 ++++-----
drivers/scsi/ufs/ufshcd.h | 2 --
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index e52e86b0b7a3..eddaa57b6aad 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2127,15 +2127,17 @@ void ufshcd_send_command(struct ufs_hba *hba,
unsigned int task_tag)
*/
static inline void ufshcd_copy_sense_data(struct ufshcd_lrb *lrbp)
{
+ u8 *sense_buffer = lrbp->cmd ? lrbp->cmd->sense_buffer : NULL;
lrbp->cmd is tested in __ufshcd_transfer_req_compl(),
which is the only caller of ufshcd_transfer_rsp_status(),
which is the only caller of ufshcd_scsi_cmd_status(),
which is the only caller of ufshcd_copy_sense_data().
Thanks for the feedback. I will update this patch and leave out the
lrbp->cmd test.
Bart.