Commit 6f553ce4 authored by John Hubbard's avatar John Hubbard Committed by Linus Torvalds

drivers/gpu/drm/via: convert put_page() to put_user_page*()

For pages that were retained via get_user_pages*(), release those pages
via the new put_user_page*() routines, instead of via put_page() or
release_pages().

This is part a tree-wide conversion, as described in fc1d8e7c ("mm:
introduce put_user_page*(), placeholder versions").

Also reverse the order of a comparison, in order to placate checkpatch.pl.

Link: http://lkml.kernel.org/r/20190724044537.10458-3-jhubbard@nvidia.comSigned-off-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2d15eb31
...@@ -174,7 +174,6 @@ via_map_blit_for_device(struct pci_dev *pdev, ...@@ -174,7 +174,6 @@ via_map_blit_for_device(struct pci_dev *pdev,
static void static void
via_free_sg_info(struct pci_dev *pdev, drm_via_sg_info_t *vsg) via_free_sg_info(struct pci_dev *pdev, drm_via_sg_info_t *vsg)
{ {
struct page *page;
int i; int i;
switch (vsg->state) { switch (vsg->state) {
...@@ -189,13 +188,8 @@ via_free_sg_info(struct pci_dev *pdev, drm_via_sg_info_t *vsg) ...@@ -189,13 +188,8 @@ via_free_sg_info(struct pci_dev *pdev, drm_via_sg_info_t *vsg)
kfree(vsg->desc_pages); kfree(vsg->desc_pages);
/* fall through */ /* fall through */
case dr_via_pages_locked: case dr_via_pages_locked:
for (i = 0; i < vsg->num_pages; ++i) { put_user_pages_dirty_lock(vsg->pages, vsg->num_pages,
if (NULL != (page = vsg->pages[i])) { (vsg->direction == DMA_FROM_DEVICE));
if (!PageReserved(page) && (DMA_FROM_DEVICE == vsg->direction))
SetPageDirty(page);
put_page(page);
}
}
/* fall through */ /* fall through */
case dr_via_pages_alloc: case dr_via_pages_alloc:
vfree(vsg->pages); vfree(vsg->pages);
......
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