]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
uio: use vma_pages() to replace (vm_end - vm_start) >> PAGE_SHIFT
authorLibin <huawei.libin@huawei.com>
Thu, 23 May 2013 00:37:11 +0000 (10:37 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 27 May 2013 06:09:01 +0000 (16:09 +1000)
(*->vm_end - *->vm_start) >> PAGE_SHIFT operation is implemented
as a inline funcion vma_pages() in linux/mm.h, so using it.

Signed-off-by: Libin <huawei.libin@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/uio/uio.c

index b645c47501b42cc4765073fa6a5d2d2bfaf60396..3b96f18593b392b8680c4e3dd6e5f188c5001c65 100644 (file)
@@ -677,7 +677,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
        if (mi < 0)
                return -EINVAL;
 
-       requested_pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+       requested_pages = vma_pages(vma);
        actual_pages = ((idev->info->mem[mi].addr & ~PAGE_MASK)
                        + idev->info->mem[mi].size + PAGE_SIZE -1) >> PAGE_SHIFT;
        if (requested_pages > actual_pages)