aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_sil24.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/sata_sil24.c')
-rw-r--r--drivers/ata/sata_sil24.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index b0619278454a..26ebffc10f3e 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -796,16 +796,19 @@ static inline void sil24_fill_sg(struct ata_queued_cmd *qc,
796 struct sil24_sge *sge) 796 struct sil24_sge *sge)
797{ 797{
798 struct scatterlist *sg; 798 struct scatterlist *sg;
799 struct sil24_sge *last_sge = NULL;
799 800
800 ata_for_each_sg(sg, qc) { 801 ata_for_each_sg(sg, qc) {
801 sge->addr = cpu_to_le64(sg_dma_address(sg)); 802 sge->addr = cpu_to_le64(sg_dma_address(sg));
802 sge->cnt = cpu_to_le32(sg_dma_len(sg)); 803 sge->cnt = cpu_to_le32(sg_dma_len(sg));
803 if (ata_sg_is_last(sg, qc)) 804 sge->flags = 0;
804 sge->flags = cpu_to_le32(SGE_TRM); 805
805 else 806 last_sge = sge;
806 sge->flags = 0;
807 sge++; 807 sge++;
808 } 808 }
809
810 if (likely(last_sge))
811 last_sge->flags = cpu_to_le32(SGE_TRM);
809} 812}
810 813
811static int sil24_qc_defer(struct ata_queued_cmd *qc) 814static int sil24_qc_defer(struct ata_queued_cmd *qc)