diff options
author | Zheng Da <zhengda1936@gmail.com> | 2010-08-08 08:08:36 +0200 |
---|---|---|
committer | Zheng Da <zhengda1936@gmail.com> | 2010-08-08 08:08:36 +0200 |
commit | e30a817d6d2a1d71223caa238781a76104a54840 (patch) | |
tree | a41418fe03091ecbd4bd7de93cc0dfb2a7f21995 /libmachdev | |
parent | 3de13f2a911c402fc1275582d30b2f934cf433e5 (diff) |
fix a bug in device_write for the block device.
Diffstat (limited to 'libmachdev')
-rw-r--r-- | libmachdev/block.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libmachdev/block.c b/libmachdev/block.c index b239ecff..48fe6cd6 100644 --- a/libmachdev/block.c +++ b/libmachdev/block.c @@ -198,12 +198,12 @@ device_write (void *d, mach_port_t reply_port, for (i = 0; i < npages; i++) { int size = PAGE_SIZE - ((int) data &~PAGE_MASK) > count ? - PAGE_SIZE - ((int) data &~PAGE_MASK) : count; + count : PAGE_SIZE - ((int) data &~PAGE_MASK); - err = block_dev_write (bd->dev, bn, data, count, write_done); + err = block_dev_write (bd->dev, bn, data, size, write_done); if (err) break; - bn += count >> 9; + bn += size >> 9; data += size; count -= size; writes++; |