scsi: ufs: mcq: Use ufshcd_mcq_req_to_hwq() to simplify updating hwq
authorChanWoo Lee <cw9316.lee@samsung.com>
Fri, 5 Jan 2024 02:10:40 +0000 (11:10 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 24 Jan 2024 02:35:33 +0000 (21:35 -0500)
Use ufshcd_mcq_req_to_hwq() to remove unnecessary variables and simplify.

Signed-off-by: ChanWoo Lee <cw9316.lee@samsung.com>
Link: https://lore.kernel.org/r/20240105021041.20400-2-cw9316.lee@samsung.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c

index f10a92681bba54c2e8ce309a2404c5be0d3d46b2..c416826762e9231c53c15d6fe9004e9edd917cda 100644 (file)
@@ -5645,7 +5645,6 @@ static void ufshcd_mcq_compl_pending_transfer(struct ufs_hba *hba,
        struct ufshcd_lrb *lrbp;
        struct scsi_cmnd *cmd;
        unsigned long flags;
-       u32 hwq_num, utag;
        int tag;
 
        for (tag = 0; tag < hba->nutrs; tag++) {
@@ -5655,9 +5654,7 @@ static void ufshcd_mcq_compl_pending_transfer(struct ufs_hba *hba,
                    test_bit(SCMD_STATE_COMPLETE, &cmd->state))
                        continue;
 
-               utag = blk_mq_unique_tag(scsi_cmd_to_rq(cmd));
-               hwq_num = blk_mq_unique_tag_to_hwq(utag);
-               hwq = &hba->uhq[hwq_num];
+               hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd));
 
                if (force_compl) {
                        ufshcd_mcq_compl_all_cqes_lock(hba, hwq);