From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752237AbcEUNL6 (ORCPT ); Sat, 21 May 2016 09:11:58 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33081 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751641AbcEUNLz (ORCPT ); Sat, 21 May 2016 09:11:55 -0400 From: Muhammad Falak R Wani To: Sudeep Dutt Cc: Ashutosh Dixit , Nikhil Rao , Greg Kroah-Hartman , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] misc: mic: scif: use vma_pages(). Date: Sat, 21 May 2016 18:41:38 +0530 Message-Id: <1463836303-16627-1-git-send-email-falakreyaz@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace explicit computation of vma page count by a call to vma_pages() Signed-off-by: Muhammad Falak R Wani --- drivers/misc/mic/scif/scif_mmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/mic/scif/scif_mmap.c b/drivers/misc/mic/scif/scif_mmap.c index 49cb8f7..9282116 100644 --- a/drivers/misc/mic/scif/scif_mmap.c +++ b/drivers/misc/mic/scif/scif_mmap.c @@ -552,7 +552,7 @@ static void scif_munmap(struct vm_area_struct *vma) { struct scif_endpt *ep; 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; struct scif_rma_req req; struct scif_window *window = NULL; @@ -614,7 +614,7 @@ int scif_mmap(struct vm_area_struct *vma, scif_epd_t epd) struct scif_window *window = NULL; struct scif_endpt *ep = (struct scif_endpt *)epd; 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; struct vma_pvt *vmapvt; -- 1.9.1