diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:14:59 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:14:59 -0400 |
commit | f2bc316736e69e5623443a010f9581a01429c075 (patch) | |
tree | 81cf3d473b722ec8a9baf726913f1d7cfc64c0c8 /drivers/ide/ide-taskfile.c | |
parent | 7a00798b1a7502ff31736152b23189138db0b978 (diff) |
ide: use PageHighMem() instead of ifdefs in ide_pio_bytes()
Use PageHighMem() instead of ifdefs in ide_pio_bytes()
(=> local IRQs won't be disabled when not necessary).
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r-- | drivers/ide/ide-taskfile.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 8d7e87d04b3b..0e333ecf2ad6 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -195,9 +195,7 @@ static void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd, | |||
195 | struct scatterlist *sg = hwif->sg_table; | 195 | struct scatterlist *sg = hwif->sg_table; |
196 | struct scatterlist *cursg = cmd->cursg; | 196 | struct scatterlist *cursg = cmd->cursg; |
197 | struct page *page; | 197 | struct page *page; |
198 | #ifdef CONFIG_HIGHMEM | ||
199 | unsigned long flags; | 198 | unsigned long flags; |
200 | #endif | ||
201 | unsigned int offset; | 199 | unsigned int offset; |
202 | u8 *buf; | 200 | u8 *buf; |
203 | 201 | ||
@@ -218,9 +216,9 @@ static void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd, | |||
218 | page = nth_page(page, (offset >> PAGE_SHIFT)); | 216 | page = nth_page(page, (offset >> PAGE_SHIFT)); |
219 | offset %= PAGE_SIZE; | 217 | offset %= PAGE_SIZE; |
220 | 218 | ||
221 | #ifdef CONFIG_HIGHMEM | 219 | if (PageHighMem(page)) |
222 | local_irq_save(flags); | 220 | local_irq_save(flags); |
223 | #endif | 221 | |
224 | buf = kmap_atomic(page, KM_BIO_SRC_IRQ) + offset; | 222 | buf = kmap_atomic(page, KM_BIO_SRC_IRQ) + offset; |
225 | 223 | ||
226 | cmd->nleft -= nr_bytes; | 224 | cmd->nleft -= nr_bytes; |
@@ -238,9 +236,9 @@ static void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd, | |||
238 | hwif->tp_ops->input_data(drive, cmd, buf, nr_bytes); | 236 | hwif->tp_ops->input_data(drive, cmd, buf, nr_bytes); |
239 | 237 | ||
240 | kunmap_atomic(buf, KM_BIO_SRC_IRQ); | 238 | kunmap_atomic(buf, KM_BIO_SRC_IRQ); |
241 | #ifdef CONFIG_HIGHMEM | 239 | |
242 | local_irq_restore(flags); | 240 | if (PageHighMem(page)) |
243 | #endif | 241 | local_irq_restore(flags); |
244 | 242 | ||
245 | len -= nr_bytes; | 243 | len -= nr_bytes; |
246 | } | 244 | } |