Commit c860f955681ebd83df4a03089f1910fc4b54651f
1 parent
4de4b9e140
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 8 additions and 8 deletions Side-by-side Diff
drivers/scsi/ide-scsi.c
... | ... | @@ -139,29 +139,29 @@ |
139 | 139 | ide_hwif_t *hwif = drive->hwif; |
140 | 140 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; |
141 | 141 | xfer_func_t *xf = write ? tp_ops->output_data : tp_ops->input_data; |
142 | + struct scatterlist *sg = pc->sg; | |
142 | 143 | char *buf; |
143 | 144 | int count; |
144 | 145 | |
145 | 146 | while (bcount) { |
146 | - count = min(pc->sg->length - pc->b_count, bcount); | |
147 | - if (PageHighMem(sg_page(pc->sg))) { | |
147 | + count = min(sg->length - pc->b_count, bcount); | |
148 | + if (PageHighMem(sg_page(sg))) { | |
148 | 149 | unsigned long flags; |
149 | 150 | |
150 | 151 | local_irq_save(flags); |
151 | - buf = kmap_atomic(sg_page(pc->sg), KM_IRQ0) + | |
152 | - pc->sg->offset; | |
152 | + buf = kmap_atomic(sg_page(sg), KM_IRQ0) + sg->offset; | |
153 | 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 | 155 | local_irq_restore(flags); |
156 | 156 | } else { |
157 | - buf = sg_virt(pc->sg); | |
157 | + buf = sg_virt(sg); | |
158 | 158 | xf(drive, NULL, buf + pc->b_count, count); |
159 | 159 | } |
160 | 160 | bcount -= count; pc->b_count += count; |
161 | - if (pc->b_count == pc->sg->length) { | |
161 | + if (pc->b_count == sg->length) { | |
162 | 162 | if (!--pc->sg_cnt) |
163 | 163 | break; |
164 | - pc->sg = sg_next(pc->sg); | |
164 | + pc->sg = sg = sg_next(sg); | |
165 | 165 | pc->b_count = 0; |
166 | 166 | } |
167 | 167 | } |