diff options
author | John Hubbard <jhubbard@nvidia.com> | 2019-09-23 18:35:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-24 18:54:08 -0400 |
commit | 6f553ce498a72d91c1c9361fd49bcf07e17c9703 (patch) | |
tree | 2387c5b11f0a1ff268731bfa88ad392e73924659 | |
parent | 2d15eb31b50a1b93927bdb7cc5d9960b90f7c1e4 (diff) |
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 fc1d8e7cca2d ("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.com
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/gpu/drm/via/via_dmablit.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c index feaa538026a0..3db000aacd26 100644 --- a/drivers/gpu/drm/via/via_dmablit.c +++ b/drivers/gpu/drm/via/via_dmablit.c | |||
@@ -174,7 +174,6 @@ via_map_blit_for_device(struct pci_dev *pdev, | |||
174 | static void | 174 | static void |
175 | via_free_sg_info(struct pci_dev *pdev, drm_via_sg_info_t *vsg) | 175 | via_free_sg_info(struct pci_dev *pdev, drm_via_sg_info_t *vsg) |
176 | { | 176 | { |
177 | struct page *page; | ||
178 | int i; | 177 | int i; |
179 | 178 | ||
180 | switch (vsg->state) { | 179 | switch (vsg->state) { |
@@ -189,13 +188,8 @@ via_free_sg_info(struct pci_dev *pdev, drm_via_sg_info_t *vsg) | |||
189 | kfree(vsg->desc_pages); | 188 | kfree(vsg->desc_pages); |
190 | /* fall through */ | 189 | /* fall through */ |
191 | case dr_via_pages_locked: | 190 | case dr_via_pages_locked: |
192 | for (i = 0; i < vsg->num_pages; ++i) { | 191 | put_user_pages_dirty_lock(vsg->pages, vsg->num_pages, |
193 | if (NULL != (page = vsg->pages[i])) { | 192 | (vsg->direction == DMA_FROM_DEVICE)); |
194 | if (!PageReserved(page) && (DMA_FROM_DEVICE == vsg->direction)) | ||
195 | SetPageDirty(page); | ||
196 | put_page(page); | ||
197 | } | ||
198 | } | ||
199 | /* fall through */ | 193 | /* fall through */ |
200 | case dr_via_pages_alloc: | 194 | case dr_via_pages_alloc: |
201 | vfree(vsg->pages); | 195 | vfree(vsg->pages); |