Skip to contentSkip to conversation

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

PATCH New sayli karnik 1 participant 1 message Sep 19, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/staging/comedi/comedi_fops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/comedi_fops.c +1 -1
index bf922ea..64b3966 100644
@@ -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);
Signature · 1 line
2.7.4