Commit 17fd47ab authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f1fc78a8
...@@ -180,19 +180,12 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne ...@@ -180,19 +180,12 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne
return; return;
} }
count = min(pc->sg->length - pc->b_count, bcount); count = min(pc->sg->length - pc->b_count, bcount);
if (PageHighMem(pc->sg->page)) { buf = kmap_atomic(pc->sg->page, KM_IRQ0);
unsigned long flags; drive->hwif->atapi_input_bytes(drive,
buf + pc->b_count + pc->sg->offset, count);
local_irq_save(flags); kunmap_atomic(buf, KM_IRQ0);
buf = kmap_atomic(pc->sg->page, KM_IRQ0) + pc->sg->offset; bcount -= count;
drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count); pc->b_count += count;
kunmap_atomic(buf - pc->sg->offset, KM_IRQ0);
local_irq_restore(flags);
} else {
buf = page_address(pc->sg->page) + pc->sg->offset;
drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count);
}
bcount -= count; pc->b_count += count;
if (pc->b_count == pc->sg->length) { if (pc->b_count == pc->sg->length) {
pc->sg++; pc->sg++;
pc->b_count = 0; pc->b_count = 0;
...@@ -212,19 +205,12 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign ...@@ -212,19 +205,12 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign
return; return;
} }
count = min(pc->sg->length - pc->b_count, bcount); count = min(pc->sg->length - pc->b_count, bcount);
if (PageHighMem(pc->sg->page)) { buf = kmap_atomic(pc->sg->page, KM_IRQ0);
unsigned long flags; drive->hwif->atapi_output_bytes(drive,
buf + pc->b_count + pc->sg->offset, count);
local_irq_save(flags); kunmap_atomic(buf, KM_IRQ0);
buf = kmap_atomic(pc->sg->page, KM_IRQ0) + pc->sg->offset; bcount -= count;
drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count); pc->b_count += count;
kunmap_atomic(buf - pc->sg->offset, KM_IRQ0);
local_irq_restore(flags);
} else {
buf = page_address(pc->sg->page) + pc->sg->offset;
drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count);
}
bcount -= count; pc->b_count += count;
if (pc->b_count == pc->sg->length) { if (pc->b_count == pc->sg->length) {
pc->sg++; pc->sg++;
pc->b_count = 0; pc->b_count = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment