Skip to content

Commit 360190b

Browse files
committed
ata: libata-scsi: improve readability of ata_scsi_qc_issue()
Improve readability of ata_scsi_qc_issue(). No functional changes. Tested-by: Tommy Kelly <linux@tkel.ly> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Niklas Cassel <cassel@kernel.org>
1 parent 163f649 commit 360190b

1 file changed

Lines changed: 21 additions & 22 deletions

File tree

drivers/ata/libata-scsi.c

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,7 +1767,7 @@ static int ata_scsi_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc)
17671767
int ret;
17681768

17691769
if (!ap->ops->qc_defer)
1770-
goto issue;
1770+
goto issue_qc;
17711771

17721772
/*
17731773
* If we already have a deferred qc, then rely on the SCSI layer to
@@ -1786,38 +1786,37 @@ static int ata_scsi_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc)
17861786
break;
17871787
case ATA_DEFER_LINK:
17881788
ret = SCSI_MLQUEUE_DEVICE_BUSY;
1789-
break;
1789+
goto defer_qc;
17901790
case ATA_DEFER_PORT:
17911791
ret = SCSI_MLQUEUE_HOST_BUSY;
1792-
break;
1792+
goto defer_qc;
17931793
default:
17941794
WARN_ON_ONCE(1);
17951795
ret = SCSI_MLQUEUE_HOST_BUSY;
1796-
break;
1796+
goto defer_qc;
17971797
}
17981798

1799-
if (ret) {
1800-
/*
1801-
* We must defer this qc: if this is not an NCQ command, keep
1802-
* this qc as a deferred one and report to the SCSI layer that
1803-
* we issued it so that it is not requeued. The deferred qc will
1804-
* be issued with the port deferred_qc_work once all on-going
1805-
* commands complete.
1806-
*/
1807-
if (!ata_is_ncq(qc->tf.protocol)) {
1808-
ap->deferred_qc = qc;
1809-
return 0;
1810-
}
1799+
issue_qc:
1800+
ata_qc_issue(qc);
1801+
return 0;
18111802

1812-
/* Force a requeue of the command to defer its execution. */
1813-
ata_qc_free(qc);
1814-
return ret;
1803+
defer_qc:
1804+
/*
1805+
* We must defer this qc: if this is not an NCQ command, keep
1806+
* this qc as a deferred one and report to the SCSI layer that
1807+
* we issued it so that it is not requeued. The deferred qc will
1808+
* be issued with the port deferred_qc_work once all on-going
1809+
* commands complete.
1810+
*/
1811+
if (!ata_is_ncq(qc->tf.protocol)) {
1812+
ap->deferred_qc = qc;
1813+
return 0;
18151814
}
18161815

1817-
issue:
1818-
ata_qc_issue(qc);
1816+
/* Force a requeue of the command to defer its execution. */
1817+
ata_qc_free(qc);
18191818

1820-
return 0;
1819+
return ret;
18211820
}
18221821

18231822
/**

0 commit comments

Comments
 (0)