diff options
author | Andrew Morton <akpm@osdl.org> | 2005-10-30 18:00:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 20:37:17 -0500 |
commit | 17fd47ab4d33e764216b87006d8118fa050b4c92 (patch) | |
tree | c6016a8741a2527acac0ceb6e6ce431a798d6708 /drivers/scsi | |
parent | f1fc78a8c7f3a784b9fd1e07cc1438a0ea569555 (diff) |
[PATCH] ide-scsi highmem cleanup
It's not necessary to test PageHighmem in here - kmap_atomic() does the right
thing.
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/ide-scsi.c | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 3d62c9bcbff7..00d6a6657ebc 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -180,19 +180,12 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne | |||
180 | return; | 180 | return; |
181 | } | 181 | } |
182 | count = min(pc->sg->length - pc->b_count, bcount); | 182 | count = min(pc->sg->length - pc->b_count, bcount); |
183 | if (PageHighMem(pc->sg->page)) { | 183 | buf = kmap_atomic(pc->sg->page, KM_IRQ0); |
184 | unsigned long flags; | 184 | drive->hwif->atapi_input_bytes(drive, |
185 | 185 | buf + pc->b_count + pc->sg->offset, count); | |
186 | local_irq_save(flags); | 186 | kunmap_atomic(buf, KM_IRQ0); |
187 | buf = kmap_atomic(pc->sg->page, KM_IRQ0) + pc->sg->offset; | 187 | bcount -= count; |
188 | drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count); | 188 | pc->b_count += count; |
189 | kunmap_atomic(buf - pc->sg->offset, KM_IRQ0); | ||
190 | local_irq_restore(flags); | ||
191 | } else { | ||
192 | buf = page_address(pc->sg->page) + pc->sg->offset; | ||
193 | drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count); | ||
194 | } | ||
195 | bcount -= count; pc->b_count += count; | ||
196 | if (pc->b_count == pc->sg->length) { | 189 | if (pc->b_count == pc->sg->length) { |
197 | pc->sg++; | 190 | pc->sg++; |
198 | pc->b_count = 0; | 191 | pc->b_count = 0; |
@@ -212,19 +205,12 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign | |||
212 | return; | 205 | return; |
213 | } | 206 | } |
214 | count = min(pc->sg->length - pc->b_count, bcount); | 207 | count = min(pc->sg->length - pc->b_count, bcount); |
215 | if (PageHighMem(pc->sg->page)) { | 208 | buf = kmap_atomic(pc->sg->page, KM_IRQ0); |
216 | unsigned long flags; | 209 | drive->hwif->atapi_output_bytes(drive, |
217 | 210 | buf + pc->b_count + pc->sg->offset, count); | |
218 | local_irq_save(flags); | 211 | kunmap_atomic(buf, KM_IRQ0); |
219 | buf = kmap_atomic(pc->sg->page, KM_IRQ0) + pc->sg->offset; | 212 | bcount -= count; |
220 | drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count); | 213 | pc->b_count += count; |
221 | kunmap_atomic(buf - pc->sg->offset, KM_IRQ0); | ||
222 | local_irq_restore(flags); | ||
223 | } else { | ||
224 | buf = page_address(pc->sg->page) + pc->sg->offset; | ||
225 | drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count); | ||
226 | } | ||
227 | bcount -= count; pc->b_count += count; | ||
228 | if (pc->b_count == pc->sg->length) { | 214 | if (pc->b_count == pc->sg->length) { |
229 | pc->sg++; | 215 | pc->sg++; |
230 | pc->b_count = 0; | 216 | pc->b_count = 0; |