diff options
-rw-r--r-- | drivers/ata/libata-core.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index c9242301cfa1..ca4d208ddf3b 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -5031,7 +5031,6 @@ int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active) | |||
5031 | { | 5031 | { |
5032 | int nr_done = 0; | 5032 | int nr_done = 0; |
5033 | u32 done_mask; | 5033 | u32 done_mask; |
5034 | int i; | ||
5035 | 5034 | ||
5036 | done_mask = ap->qc_active ^ qc_active; | 5035 | done_mask = ap->qc_active ^ qc_active; |
5037 | 5036 | ||
@@ -5041,16 +5040,16 @@ int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active) | |||
5041 | return -EINVAL; | 5040 | return -EINVAL; |
5042 | } | 5041 | } |
5043 | 5042 | ||
5044 | for (i = 0; i < ATA_MAX_QUEUE; i++) { | 5043 | while (done_mask) { |
5045 | struct ata_queued_cmd *qc; | 5044 | struct ata_queued_cmd *qc; |
5045 | unsigned int tag = __ffs(done_mask); | ||
5046 | 5046 | ||
5047 | if (!(done_mask & (1 << i))) | 5047 | qc = ata_qc_from_tag(ap, tag); |
5048 | continue; | 5048 | if (qc) { |
5049 | |||
5050 | if ((qc = ata_qc_from_tag(ap, i))) { | ||
5051 | ata_qc_complete(qc); | 5049 | ata_qc_complete(qc); |
5052 | nr_done++; | 5050 | nr_done++; |
5053 | } | 5051 | } |
5052 | done_mask &= ~(1 << tag); | ||
5054 | } | 5053 | } |
5055 | 5054 | ||
5056 | return nr_done; | 5055 | return nr_done; |