aboutsummaryrefslogtreecommitdiff
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
authorLinus Torvalds2013-07-10 18:15:41 -0700
committerLinus Torvalds2013-07-10 18:15:41 -0700
commit4ece92df296f472e49d26ee38ddbed4596458132 (patch)
tree0b2960114194d20769273dadb0bf2897c8e0206a /drivers/ide/ide-taskfile.c
parent75fcf64dc7180a6258dbefd671edb9d86a38d22f (diff)
parent1581208b2f0643eebfa7a3fbe5bad831c0bb7f0e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide
Pull IDE updates from David Miller: "Just a few small things: 1) module_platform_driver_probe() conversions from Jingoo Han. 2) module_pci_driver() conversion from Libo Chen. 3) PIO size calculation fix from Steven J Hill" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide: ide: Fix IDE PIO size calculation drivers/ide/delkin_cb: Convert to module_pci_driver ide: gayle: use module_platform_driver_probe() ide: tx4939ide: use module_platform_driver_probe() ide: tx4938ide: use module_platform_driver_probe()
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 729428edeba2..dabb88b1cbec 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -239,9 +239,6 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,
unsigned nr_bytes = min(len, cursg->length - cmd->cursg_ofs);
int page_is_high;
- if (nr_bytes > PAGE_SIZE)
- nr_bytes = PAGE_SIZE;
-
page = sg_page(cursg);
offset = cursg->offset + cmd->cursg_ofs;
@@ -249,6 +246,8 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,
page = nth_page(page, (offset >> PAGE_SHIFT));
offset %= PAGE_SIZE;
+ nr_bytes = min_t(unsigned, nr_bytes, (PAGE_SIZE - offset));
+
page_is_high = PageHighMem(page);
if (page_is_high)
local_irq_save(flags);