From ec9d0754e0c64013278fda87d1bd6b8318747abe Mon Sep 17 00:00:00 2001 From: sayli karnik Date: Tue, 20 Sep 2016 03:21:38 +0530 Subject: [PATCH] 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/comedi_fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index bf922eafe07c..64b3966c5f1f 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -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); -- 2.20.1