Commit acde785e authored by Muhammad Falak R Wani's avatar Muhammad Falak R Wani Committed by Greg Kroah-Hartman

misc: mic: scif: use vma_pages().

Replace explicit computation of vma page count by a call to
vma_pages()
Signed-off-by: default avatarMuhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b6faae97
...@@ -552,7 +552,7 @@ static void scif_munmap(struct vm_area_struct *vma) ...@@ -552,7 +552,7 @@ static void scif_munmap(struct vm_area_struct *vma)
{ {
struct scif_endpt *ep; struct scif_endpt *ep;
struct vma_pvt *vmapvt = vma->vm_private_data; struct vma_pvt *vmapvt = vma->vm_private_data;
int nr_pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; int nr_pages = vma_pages(vma);
s64 offset; s64 offset;
struct scif_rma_req req; struct scif_rma_req req;
struct scif_window *window = NULL; struct scif_window *window = NULL;
...@@ -614,7 +614,7 @@ int scif_mmap(struct vm_area_struct *vma, scif_epd_t epd) ...@@ -614,7 +614,7 @@ int scif_mmap(struct vm_area_struct *vma, scif_epd_t epd)
struct scif_window *window = NULL; struct scif_window *window = NULL;
struct scif_endpt *ep = (struct scif_endpt *)epd; struct scif_endpt *ep = (struct scif_endpt *)epd;
s64 start_offset = vma->vm_pgoff << PAGE_SHIFT; s64 start_offset = vma->vm_pgoff << PAGE_SHIFT;
int nr_pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; int nr_pages = vma_pages(vma);
int err; int err;
struct vma_pvt *vmapvt; struct vma_pvt *vmapvt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment