From patchwork Thu Sep 21 10:38:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 9963683 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 17677600C5 for ; Thu, 21 Sep 2017 10:38:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 132CE29446 for ; Thu, 21 Sep 2017 10:38:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06C7829448; Thu, 21 Sep 2017 10:38:57 +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=-2.7 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB 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 9D30F29446 for ; Thu, 21 Sep 2017 10:38:56 +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=BE0SoZ9JyotkScxZlXi3HAKwBV0X6CUrI/OvwZ4rNqQ=; b=aSz 0lBimQmpJREQmk2UVCVxkG6esLNDRyKjdcu71GEki7v+qwaD8Nd6UmdCg7X+VqO1vGykV06xCN3Nz O50vBwH/HgcgWuIPUSTnd+sVll4GOmif5FKQAYCbv+DMJYxyn6JGX+hsAZgz9qvp8Q/twd+LrTcFG uQiE7buJUTU3vy17/nHQVgrCu7L8hC99KusD0MgcXpjjBty5SG+6HHnnbK4ZbSwl5WG6CJrlkWPM7 aoKmNiDFb3/B2NwCK5zggCR5EemnpSEhNQUsQBVfaSxG5B8RS2dwe11FdvF2PYqbxrmuq7fFG3BGA ftYjZTNrHnPkxdTSWpx+H00MPXQAYlg==; 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 1duysi-0001jt-5Z; Thu, 21 Sep 2017 10:38:56 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1duysd-0001ek-Jz for linux-rockchip@lists.infradead.org; Thu, 21 Sep 2017 10:38:53 +0000 Received: by mail-pf0-x242.google.com with SMTP id f84so2342008pfj.3 for ; Thu, 21 Sep 2017 03:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=RPEjC1ixi0Yo385PpIdqFTUT1n+UpMKp2l/0JO6edlU=; b=X3RoxlEpLYsqf7dPRZhBx2OUZRAPkML+hkpQa4i6Txps3D4/7TTAH1kc6tYTeE9MOj bbV4DJBmnbwwLvyxpVaJalomFU6jsLR/06BCTE44pR1DYBlbCzFq+fltev25XnYNjXZe QRu39DGgzoIHSMCZksvSM2ycsgsRZP5AGNWOn434in6K0ckC4x/0YIoYnL8MaD/huWyG DR7IvQU9AvIuFenDWFIygj0BfqIoZKueVtkiP2aApetGjft+OAGRYSjl69Gdf7SLIMsK flx7f91r0EqbZSJ9R+u7BEmxhuDckScAGQd3a3w/ZzVof7k/bA7ajSZS0LOfl9+c9rSZ fvNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RPEjC1ixi0Yo385PpIdqFTUT1n+UpMKp2l/0JO6edlU=; b=cDXJYDHp5THm484hVQ54OKX67EKwIu9luvnCp96PS0NQImnLfdy7PqJPtmzl+Mc6nr tvcMW9OpKsRJ6H4fTNqOf2mo6+qSTe49vbv5WKJMBEM/4bgWGhgvYo8hHno2hsMlkXBk EBJ2Dl8KUVbtzBTIWqpvGtz1XXhb1EcU9nBgNPVeehJIdq17L+fqnXZhZaXi3B/S44bx 24MjlmHJvO9d8pCtaXyR//dZaG3MwD5HLvWZsh+ym6jyCvetzi604GlIt/g2ESS1QVu3 9U8jwKn5G7shVgXZYwbmlh1dCVzNKV3DNPebZvDfAjDVz0uYNH2Vi1mSgVqDR1LDVcbJ D8nQ== X-Gm-Message-State: AHPjjUgzlgzLMUZqc56OByxc7GGSaJn8E3Jk7n9cjXY7e6TVSL/KZyrE JeBnkUM+r+biB70Lef5cIbU= X-Google-Smtp-Source: AOwi7QCT/XsYbTgsL7QCwA6VKVuuWK3rGiOAdmohrrwiSmUaE0bSUs4+nbMrc3OZHL1EAf22uKUI8A== X-Received: by 10.84.177.36 with SMTP id w33mr5091262plb.427.1505990310728; Thu, 21 Sep 2017 03:38:30 -0700 (PDT) Received: from localhost.localdomain ([103.42.74.194]) by smtp.gmail.com with ESMTPSA id l12sm2213457pgr.10.2017.09.21.03.38.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Sep 2017 03:38:29 -0700 (PDT) From: Allen Pais To: linux-kernel@vger.kernel.org Subject: [PATCH 1/1] drivers:gpu: Use vma_pages() Date: Thu, 21 Sep 2017 16:08:23 +0530 Message-Id: <1505990303-27763-1-git-send-email-allen.lkml@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170921_033851_854632_8C18A57F X-CRM114-Status: UNSURE ( 8.78 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, Allen Pais , mark.yao@rock-chips.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Replace explicit computation of vma page count by a call to vma_pages() Signed-off-by: Allen Pais --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 1869c8b..d4c429c 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -220,7 +220,7 @@ static int rockchip_drm_gem_object_mmap_iommu(struct drm_gem_object *obj, { struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj); unsigned int i, count = obj->size >> PAGE_SHIFT; - unsigned long user_count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; + unsigned long user_count = vma_pages(vma); unsigned long uaddr = vma->vm_start; unsigned long offset = vma->vm_pgoff; unsigned long end = user_count + offset;