summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 22:39:36 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 22:39:36 +0200
commitc860f955681ebd83df4a03089f1910fc4b54651f (patch)
treefe13b4bba7903747c5760d2bc2a1c7df2048fd90 /drivers
parent4de4b9e1405aef41d199dd20dbce7e9a5dbbf7bf (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')
-rw-r--r--drivers/scsi/ide-scsi.c16
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,
ide_hwif_t *hwif = drive->hwif;
const struct ide_tp_ops *tp_ops = hwif->tp_ops;
xfer_func_t *xf = write ? tp_ops->output_data : tp_ops->input_data;
+ struct scatterlist *sg = pc->sg;
char *buf;
int count;
while (bcount) {
- count = min(pc->sg->length - pc->b_count, bcount);
- if (PageHighMem(sg_page(pc->sg))) {
+ count = min(sg->length - pc->b_count, bcount);
+ if (PageHighMem(sg_page(sg))) {
unsigned long flags;
local_irq_save(flags);
- buf = kmap_atomic(sg_page(pc->sg), KM_IRQ0) +
- pc->sg->offset;
+ buf = kmap_atomic(sg_page(sg), KM_IRQ0) + sg->offset;
xf(drive, NULL, buf + pc->b_count, count);
- kunmap_atomic(buf - pc->sg->offset, KM_IRQ0);
+ kunmap_atomic(buf - sg->offset, KM_IRQ0);
local_irq_restore(flags);
} else {
- buf = sg_virt(pc->sg);
+ buf = sg_virt(sg);
xf(drive, NULL, buf + pc->b_count, count);
}
bcount -= count; pc->b_count += count;
- if (pc->b_count == pc->sg->length) {
+ if (pc->b_count == sg->length) {
if (!--pc->sg_cnt)
break;
- pc->sg = sg_next(pc->sg);
+ pc->sg = sg = sg_next(sg);
pc->b_count = 0;
}
}