staging: comedi: Use vma_pages function on vma object instead of explicit computation

This patch uses vma_pages function on vma object instead of explicit
computation.

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
sayli karnik 2016-09-20 03:21:38 +05:30 committed by Greg Kroah-Hartman
parent 33d877bb42
commit ec9d0754e0

View File

@ -2233,7 +2233,7 @@ static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
goto done;
}
n_pages = size >> PAGE_SHIFT;
n_pages = vma_pages(vma);
/* get reference to current buf map (if any) */
bm = comedi_buf_map_from_subdev_get(s);