From patchwork Thu Oct 5 12:16:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 9987011 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1F0C96029B for ; Thu, 5 Oct 2017 12:17:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C73828C60 for ; Thu, 5 Oct 2017 12:17:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0136928C68; Thu, 5 Oct 2017 12:17:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CC3B528C60 for ; Thu, 5 Oct 2017 12:17:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=pld8DFPyee7myOxjc5/K3GyXY0H0F9piijcbppIG6Eg=; b=joW Fo46vZ3zrD2ex7CycQsuKc8L5kuU2C/wGqyAUaN2Dm8RHsHjsCxjMORN9zMEUTCKf1M8HO8tIr8ch 8tBZIuboN8kb7bZG5nl2jzTqjDrS3mJAyy6fe/2Xjyx8oln1sFeQPe0IetHg+ibeKKHTKxpbYvzrf c1LRq+MKtqe9mZ8RkRyFehKdIsF3ysjvnb4eYZrh1cCxgutkMAeZCR9tlWfiHqjNHFZqG6HZwGsXI Kw/1/jDkDyQqyNs9c7t4DXRZoM5iAZDdMoLPLCNCojzQAsga6waijsDZNaQpxkQkK0ON8tMX+iMVJ 1f2JW4/BmtsqH7flTFFKhec88oPBd/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e055s-0007mT-4F; Thu, 05 Oct 2017 12:17:36 +0000 Received: from aserp1040.oracle.com ([141.146.126.69]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e055n-0007h7-DX for linux-arm-kernel@lists.infradead.org; Thu, 05 Oct 2017 12:17:33 +0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v95CH47q018828 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 5 Oct 2017 12:17:05 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v95CH4Rw028422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 5 Oct 2017 12:17:04 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v95CH4hU008719; Thu, 5 Oct 2017 12:17:04 GMT Received: from x250.idc.oracle.com (/10.191.201.200) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 05 Oct 2017 05:17:03 -0700 From: Allen Pais To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64: use vma_pages helper Date: Thu, 5 Oct 2017 17:46:55 +0530 Message-Id: <1507205815-5204-1-git-send-email-allen.pais@oracle.com> X-Mailer: git-send-email 1.9.1 X-Source-IP: userv0021.oracle.com [156.151.31.71] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171005_051731_641675_83E40447 X-CRM114-Status: UNSURE ( 7.60 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: will.deacon@arm.com, linux-kernel@vger.kernel.org, Allen Pais MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use vma_pages function on vma object instead of explicit computation. This is a clean up patch. Signed-off-by: Allen Pais --- arch/arm64/mm/dma-mapping.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 614af88..5f62090 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c @@ -303,8 +303,7 @@ static int __swiotlb_mmap_pfn(struct vm_area_struct *vma, unsigned long pfn, size_t size) { int ret = -ENXIO; - unsigned long nr_vma_pages = (vma->vm_end - vma->vm_start) >> - PAGE_SHIFT; + unsigned long nr_vma_pages = vma_pages(vma); unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; unsigned long off = vma->vm_pgoff;