|
@@ -5031,7 +5031,6 @@ int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active)
|
|
|
{
|
|
|
int nr_done = 0;
|
|
|
u32 done_mask;
|
|
|
- int i;
|
|
|
|
|
|
done_mask = ap->qc_active ^ qc_active;
|
|
|
|
|
@@ -5041,16 +5040,16 @@ int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active)
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
- for (i = 0; i < ATA_MAX_QUEUE; i++) {
|
|
|
+ while (done_mask) {
|
|
|
struct ata_queued_cmd *qc;
|
|
|
+ unsigned int tag = __ffs(done_mask);
|
|
|
|
|
|
- if (!(done_mask & (1 << i)))
|
|
|
- continue;
|
|
|
-
|
|
|
- if ((qc = ata_qc_from_tag(ap, i))) {
|
|
|
+ qc = ata_qc_from_tag(ap, tag);
|
|
|
+ if (qc) {
|
|
|
ata_qc_complete(qc);
|
|
|
nr_done++;
|
|
|
}
|
|
|
+ done_mask &= ~(1 << tag);
|
|
|
}
|
|
|
|
|
|
return nr_done;
|