aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-05-11 12:51:07 -0600
committerTejun Heo <tj@kernel.org>2018-05-11 13:10:43 -0700
commit9d207accca2c262206d0a9327ef1444c70cc0bdf (patch)
treeb75c06516fd9545db853c20dc1320e2728620277 /drivers/ata
parentlibata: use ata_tag_internal() consistently (diff)
downloadlinux-dev-9d207accca2c262206d0a9327ef1444c70cc0bdf.tar.xz
linux-dev-9d207accca2c262206d0a9327ef1444c70cc0bdf.zip
libata: remove assumption that ATA_MAX_QUEUE - 1 is the max
In a few spots we iterate to ATA_MAX_QUEUE -1, including internal knowledge that the last tag is the internal tag. Remove this assumption. Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-eh.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 1035de1e5120..9f9aad77fbcd 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -873,9 +873,12 @@ static int ata_eh_nr_in_flight(struct ata_port *ap)
int nr = 0;
/* count only non-internal commands */
- for (tag = 0; tag < ATA_MAX_QUEUE - 1; tag++)
+ for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
+ if (ata_tag_internal(tag))
+ continue;
if (ata_qc_from_tag(ap, tag))
nr++;
+ }
return nr;
}
@@ -900,7 +903,7 @@ void ata_eh_fastdrain_timerfn(struct timer_list *t)
/* No progress during the last interval, tag all
* in-flight qcs as timed out and freeze the port.
*/
- for (tag = 0; tag < ATA_MAX_QUEUE - 1; tag++) {
+ for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
struct ata_queued_cmd *qc = ata_qc_from_tag(ap, tag);
if (qc)
qc->err_mask |= AC_ERR_TIMEOUT;