Skip to content

Commit 9a5eb2a

Browse files
committed
ata: libata-scsi: simplify ata_scsi_requeue_deferred_qc()
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>
1 parent a21b404 commit 9a5eb2a

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/ata/libata-scsi.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,6 @@ void ata_scsi_deferred_qc_work(struct work_struct *work)
16851685
void ata_scsi_requeue_deferred_qc(struct ata_port *ap)
16861686
{
16871687
struct ata_queued_cmd *qc = ap->deferred_qc;
1688-
struct scsi_cmnd *scmd;
16891688

16901689
lockdep_assert_held(ap->lock);
16911690

@@ -1697,11 +1696,9 @@ void ata_scsi_requeue_deferred_qc(struct ata_port *ap)
16971696
if (!qc)
16981697
return;
16991698

1700-
scmd = qc->scsicmd;
17011699
ap->deferred_qc = NULL;
1702-
ata_qc_free(qc);
1703-
scmd->result = (DID_SOFT_ERROR << 16);
1704-
scsi_done(scmd);
1700+
qc->scsicmd->result = (DID_SOFT_ERROR << 16);
1701+
ata_qc_done(qc);
17051702
}
17061703

17071704
static void ata_scsi_schedule_deferred_qc(struct ata_port *ap)

0 commit comments

Comments
 (0)