diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:36 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:36 -0400 |
commit | c860f955681ebd83df4a03089f1910fc4b54651f (patch) | |
tree | fe13b4bba7903747c5760d2bc2a1c7df2048fd90 /drivers/scsi/ide-scsi.c | |
parent | 4de4b9e1405aef41d199dd20dbce7e9a5dbbf7bf (diff) |
ide-scsi: cleanup ide_scsi_io_buffers()
Preparation for ide_{floppy,scsi}_io_buffers() unification.
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/scsi/ide-scsi.c')
-rw-r--r-- | drivers/scsi/ide-scsi.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index a2d003c5e85f..26e8c3c49474 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -139,29 +139,29 @@ static void ide_scsi_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
139 | ide_hwif_t *hwif = drive->hwif; | 139 | ide_hwif_t *hwif = drive->hwif; |
140 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; | 140 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; |
141 | xfer_func_t *xf = write ? tp_ops->output_data : tp_ops->input_data; | 141 | xfer_func_t *xf = write ? tp_ops->output_data : tp_ops->input_data; |
142 | struct scatterlist *sg = pc->sg; | ||
142 | char *buf; | 143 | char *buf; |
143 | int count; | 144 | int count; |
144 | 145 | ||
145 | while (bcount) { | 146 | while (bcount) { |
146 | count = min(pc->sg->length - pc->b_count, bcount); | 147 | count = min(sg->length - pc->b_count, bcount); |
147 | if (PageHighMem(sg_page(pc->sg))) { | 148 | if (PageHighMem(sg_page(sg))) { |
148 | unsigned long flags; | 149 | unsigned long flags; |
149 | 150 | ||
150 | local_irq_save(flags); | 151 | local_irq_save(flags); |
151 | buf = kmap_atomic(sg_page(pc->sg), KM_IRQ0) + | 152 | buf = kmap_atomic(sg_page(sg), KM_IRQ0) + sg->offset; |
152 | pc->sg->offset; | ||
153 | xf(drive, NULL, buf + pc->b_count, count); | 153 | xf(drive, NULL, buf + pc->b_count, count); |
154 | kunmap_atomic(buf - pc->sg->offset, KM_IRQ0); | 154 | kunmap_atomic(buf - sg->offset, KM_IRQ0); |
155 | local_irq_restore(flags); | 155 | local_irq_restore(flags); |
156 | } else { | 156 | } else { |
157 | buf = sg_virt(pc->sg); | 157 | buf = sg_virt(sg); |
158 | xf(drive, NULL, buf + pc->b_count, count); | 158 | xf(drive, NULL, buf + pc->b_count, count); |
159 | } | 159 | } |
160 | bcount -= count; pc->b_count += count; | 160 | bcount -= count; pc->b_count += count; |
161 | if (pc->b_count == pc->sg->length) { | 161 | if (pc->b_count == sg->length) { |
162 | if (!--pc->sg_cnt) | 162 | if (!--pc->sg_cnt) |
163 | break; | 163 | break; |
164 | pc->sg = sg_next(pc->sg); | 164 | pc->sg = sg = sg_next(sg); |
165 | pc->b_count = 0; | 165 | pc->b_count = 0; |
166 | } | 166 | } |
167 | } | 167 | } |