Merge branch 'work.get_user_pages_fast' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / drivers / rapidio / devices / rio_mport_cdev.c
index cf8e4ec2fd48ecedc5d692e1ecb99e96cd2faf3d..665d9e94a7e1bee135b6e046d8e27a15579fee5d 100644 (file)
@@ -876,10 +876,10 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode,
         * offset within the internal buffer specified by handle parameter.
         */
        if (xfer->loc_addr) {
-               unsigned long offset;
+               unsigned int offset;
                long pinned;
 
-               offset = (unsigned long)(uintptr_t)xfer->loc_addr & ~PAGE_MASK;
+               offset = lower_32_bits(offset_in_page(xfer->loc_addr));
                nr_pages = PAGE_ALIGN(xfer->length + offset) >> PAGE_SHIFT;
 
                page_list = kmalloc_array(nr_pages,