[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190804224915.28669-16-jhubbard@nvidia.com>
Date: Sun, 4 Aug 2019 15:48:56 -0700
From: john.hubbard@...il.com
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Christoph Hellwig <hch@...radead.org>,
Dan Williams <dan.j.williams@...el.com>,
Dave Chinner <david@...morbit.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ira Weiny <ira.weiny@...el.com>, Jan Kara <jack@...e.cz>,
Jason Gunthorpe <jgg@...pe.ca>,
Jérôme Glisse <jglisse@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
amd-gfx@...ts.freedesktop.org, ceph-devel@...r.kernel.org,
devel@...verdev.osuosl.org, devel@...ts.orangefs.org,
dri-devel@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
kvm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-block@...r.kernel.org, linux-crypto@...r.kernel.org,
linux-fbdev@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-media@...r.kernel.org, linux-mm@...ck.org,
linux-nfs@...r.kernel.org, linux-rdma@...r.kernel.org,
linux-rpi-kernel@...ts.infradead.org, linux-xfs@...r.kernel.org,
netdev@...r.kernel.org, rds-devel@....oracle.com,
sparclinux@...r.kernel.org, x86@...nel.org,
xen-devel@...ts.xenproject.org, John Hubbard <jhubbard@...dia.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Eric Anholt <eric@...olt.net>,
Stefan Wahren <stefan.wahren@...e.com>,
Mihaela Muraru <mihaela.muraru21@...il.com>,
Suniel Mahesh <sunil.m@...hveda.org>,
Al Viro <viro@...iv.linux.org.uk>,
Sidong Yang <realwakka@...il.com>,
Kishore KP <kishore.p@...hveda.org>
Subject: [PATCH v2 15/34] staging/vc04_services: convert put_page() to put_user_page*()
From: John Hubbard <jhubbard@...dia.com>
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 commit fc1d8e7cca2d
("mm: introduce put_user_page*(), placeholder versions").
Acked-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Eric Anholt <eric@...olt.net>
Cc: Stefan Wahren <stefan.wahren@...e.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Mihaela Muraru <mihaela.muraru21@...il.com>
Cc: Suniel Mahesh <sunil.m@...hveda.org>
Cc: Al Viro <viro@...iv.linux.org.uk>
Cc: Sidong Yang <realwakka@...il.com>
Cc: Kishore KP <kishore.p@...hveda.org>
Cc: linux-rpi-kernel@...ts.infradead.org
Cc: linux-arm-kernel@...ts.infradead.org
Cc: devel@...verdev.osuosl.org
Signed-off-by: John Hubbard <jhubbard@...dia.com>
---
.../vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 61c69f353cdb..ec92b4c50e95 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -336,10 +336,7 @@ cleanup_pagelistinfo(struct vchiq_pagelist_info *pagelistinfo)
}
if (pagelistinfo->pages_need_release) {
- unsigned int i;
-
- for (i = 0; i < pagelistinfo->num_pages; i++)
- put_page(pagelistinfo->pages[i]);
+ put_user_pages(pagelistinfo->pages, pagelistinfo->num_pages);
}
dma_free_coherent(g_dev, pagelistinfo->pagelist_buffer_size,
@@ -454,10 +451,7 @@ create_pagelist(char __user *buf, size_t count, unsigned short type)
__func__, actual_pages, num_pages);
/* This is probably due to the process being killed */
- while (actual_pages > 0) {
- actual_pages--;
- put_page(pages[actual_pages]);
- }
+ put_user_pages(pages, actual_pages);
cleanup_pagelistinfo(pagelistinfo);
return NULL;
}
--
2.22.0
Powered by blists - more mailing lists