aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2020-10-13 16:54:35 -0700
committerLinus Torvalds <[email protected]>2020-10-13 18:38:32 -0700
commit42286f83f80f58ae2cf3889d35cc60220df49cbb (patch)
tree4d3af065cd3a51a3420e3f6940acde46a8f2943e
parent9b53122f616a74ddbbd6c97a3c8294c631a13d15 (diff)
mm/dmapool.c: replace open-coded list_for_each_entry_safe()
There is a place in the code where open-coded version of list_for_each_entry_safe() is used. Replace that with the standard macro. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Cc: Matthew Wilcox <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/dmapool.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/dmapool.c b/mm/dmapool.c
index f9fb9bbd733e..7716a7a42a1c 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -266,6 +266,7 @@ static void pool_free_page(struct dma_pool *pool, struct dma_page *page)
*/
void dma_pool_destroy(struct dma_pool *pool)
{
+ struct dma_page *page, *tmp;
bool empty = false;
if (unlikely(!pool))
@@ -281,10 +282,7 @@ void dma_pool_destroy(struct dma_pool *pool)
device_remove_file(pool->dev, &dev_attr_pools);
mutex_unlock(&pools_reg_lock);
- while (!list_empty(&pool->page_list)) {
- struct dma_page *page;
- page = list_entry(pool->page_list.next,
- struct dma_page, page_list);
+ list_for_each_entry_safe(page, tmp, &pool->page_list, page_list) {
if (is_page_busy(page)) {
if (pool->dev)
dev_err(pool->dev,