[PATCH 14/48] staging: etnaviv: use vm_insert_page() rather than vm_insert_mixed()

Lucas Stach l.stach at pengutronix.de
Fri Sep 25 04:57:26 PDT 2015


From: Russell King <rmk+kernel at arm.linux.org.uk>

We're only ever going to insert using a pointer to a struct page.  Use
vm_insert_page() rather than converting back and forth between a
struct page and a PFN.

Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
---
 drivers/staging/etnaviv/etnaviv_gem.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/etnaviv/etnaviv_gem.c b/drivers/staging/etnaviv/etnaviv_gem.c
index 0b823a9566d3..69360c899b78 100644
--- a/drivers/staging/etnaviv/etnaviv_gem.c
+++ b/drivers/staging/etnaviv/etnaviv_gem.c
@@ -217,8 +217,7 @@ int etnaviv_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
 	struct drm_gem_object *obj = vma->vm_private_data;
 	struct drm_device *dev = obj->dev;
-	struct page **pages;
-	unsigned long pfn;
+	struct page **pages, *page;
 	pgoff_t pgoff;
 	int ret;
 
@@ -240,12 +239,12 @@ int etnaviv_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 	pgoff = ((unsigned long)vmf->virtual_address -
 			vma->vm_start) >> PAGE_SHIFT;
 
-	pfn = page_to_pfn(pages[pgoff]);
+	page = pages[pgoff];
 
 	VERB("Inserting %p pfn %lx, pa %lx", vmf->virtual_address,
-			pfn, pfn << PAGE_SHIFT);
+	     page_to_pfn(page), page_to_pfn(page) << PAGE_SHIFT);
 
-	ret = vm_insert_mixed(vma, (unsigned long)vmf->virtual_address, pfn);
+	ret = vm_insert_page(vma, (unsigned long)vmf->virtual_address, page);
 
 out_unlock:
 	mutex_unlock(&dev->struct_mutex);
-- 
2.5.1



More information about the dri-devel mailing list