]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ata: libata-scsi: simplify ata_scsi_requeue_deferred_qc()
authorDamien Le Moal <dlemoal@kernel.org>
Wed, 18 Feb 2026 23:49:17 +0000 (08:49 +0900)
committerDamien Le Moal <dlemoal@kernel.org>
Tue, 24 Feb 2026 00:40:58 +0000 (09:40 +0900)
In ata_scsi_requeue_deferred_qc(), use ata_qc_done() instead of calling
ata_qc_free() and scsi_done() directly.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
drivers/ata/libata-scsi.c

index c0dd75a0287c68cfbc6d80dffaf97879edb59846..41918e21d0f83e30347927862af7b9d7ff22bd40 100644 (file)
@@ -1685,7 +1685,6 @@ void ata_scsi_deferred_qc_work(struct work_struct *work)
 void ata_scsi_requeue_deferred_qc(struct ata_port *ap)
 {
        struct ata_queued_cmd *qc = ap->deferred_qc;
-       struct scsi_cmnd *scmd;
 
        lockdep_assert_held(ap->lock);
 
@@ -1697,11 +1696,9 @@ void ata_scsi_requeue_deferred_qc(struct ata_port *ap)
        if (!qc)
                return;
 
-       scmd = qc->scsicmd;
        ap->deferred_qc = NULL;
-       ata_qc_free(qc);
-       scmd->result = (DID_SOFT_ERROR << 16);
-       scsi_done(scmd);
+       qc->scsicmd->result = (DID_SOFT_ERROR << 16);
+       ata_qc_done(qc);
 }
 
 static void ata_scsi_schedule_deferred_qc(struct ata_port *ap)