Commit 42286f83 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Torvalds

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Link: http://lkml.kernel.org/r/20200814135055.24898-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9b53122f
...@@ -266,6 +266,7 @@ static void pool_free_page(struct dma_pool *pool, struct dma_page *page) ...@@ -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) void dma_pool_destroy(struct dma_pool *pool)
{ {
struct dma_page *page, *tmp;
bool empty = false; bool empty = false;
if (unlikely(!pool)) if (unlikely(!pool))
...@@ -281,10 +282,7 @@ void dma_pool_destroy(struct dma_pool *pool) ...@@ -281,10 +282,7 @@ void dma_pool_destroy(struct dma_pool *pool)
device_remove_file(pool->dev, &dev_attr_pools); device_remove_file(pool->dev, &dev_attr_pools);
mutex_unlock(&pools_reg_lock); mutex_unlock(&pools_reg_lock);
while (!list_empty(&pool->page_list)) { list_for_each_entry_safe(page, tmp, &pool->page_list, page_list) {
struct dma_page *page;
page = list_entry(pool->page_list.next,
struct dma_page, page_list);
if (is_page_busy(page)) { if (is_page_busy(page)) {
if (pool->dev) if (pool->dev)
dev_err(pool->dev, dev_err(pool->dev,
......
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