diff options
author | Paul Mackerras <paulus@samba.org> | 2005-10-12 14:43:32 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-12 14:43:32 +1000 |
commit | b6ec995a21a9428aef620b5adf46d047a18d88b8 (patch) | |
tree | 6719121e6605cbca524b687f47336b9bbf3b8d41 /arch/ppc/kernel | |
parent | 3a5f8c5f788d68e325d9fe3c26f4df5a5aee838a (diff) | |
parent | da64c6ee6bb71bfb3f09d9bb89ce1aa4b1ee7e89 (diff) |
Merge from Linus' tree
Diffstat (limited to 'arch/ppc/kernel')
-rw-r--r-- | arch/ppc/kernel/dma-mapping.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/ppc/kernel/dma-mapping.c b/arch/ppc/kernel/dma-mapping.c index b566d982806..8edee806dae 100644 --- a/arch/ppc/kernel/dma-mapping.c +++ b/arch/ppc/kernel/dma-mapping.c @@ -401,10 +401,10 @@ EXPORT_SYMBOL(__dma_sync); static inline void __dma_sync_page_highmem(struct page *page, unsigned long offset, size_t size, int direction) { - size_t seg_size = min((size_t)PAGE_SIZE, size) - offset; + size_t seg_size = min((size_t)(PAGE_SIZE - offset), size); size_t cur_size = seg_size; unsigned long flags, start, seg_offset = offset; - int nr_segs = PAGE_ALIGN(size + (PAGE_SIZE - offset))/PAGE_SIZE; + int nr_segs = 1 + ((size - seg_size) + PAGE_SIZE - 1)/PAGE_SIZE; int seg_nr = 0; local_irq_save(flags); |