aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 75b85a8cd2d4..90e5c0deb0e0 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -236,6 +236,7 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,
236 236
237 while (len) { 237 while (len) {
238 unsigned nr_bytes = min(len, cursg->length - cmd->cursg_ofs); 238 unsigned nr_bytes = min(len, cursg->length - cmd->cursg_ofs);
239 int page_is_high;
239 240
240 if (nr_bytes > PAGE_SIZE) 241 if (nr_bytes > PAGE_SIZE)
241 nr_bytes = PAGE_SIZE; 242 nr_bytes = PAGE_SIZE;
@@ -247,7 +248,8 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,
247 page = nth_page(page, (offset >> PAGE_SHIFT)); 248 page = nth_page(page, (offset >> PAGE_SHIFT));
248 offset %= PAGE_SIZE; 249 offset %= PAGE_SIZE;
249 250
250 if (PageHighMem(page)) 251 page_is_high = PageHighMem(page);
252 if (page_is_high)
251 local_irq_save(flags); 253 local_irq_save(flags);
252 254
253 buf = kmap_atomic(page, KM_BIO_SRC_IRQ) + offset; 255 buf = kmap_atomic(page, KM_BIO_SRC_IRQ) + offset;
@@ -268,7 +270,7 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,
268 270
269 kunmap_atomic(buf, KM_BIO_SRC_IRQ); 271 kunmap_atomic(buf, KM_BIO_SRC_IRQ);
270 272
271 if (PageHighMem(page)) 273 if (page_is_high)
272 local_irq_restore(flags); 274 local_irq_restore(flags);
273 275
274 len -= nr_bytes; 276 len -= nr_bytes;