linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] mm/dmapool.c: Replace open-coded list_first_entry()
@ 2020-08-12 15:30 Andy Shevchenko
  2020-08-12 18:41 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2020-08-12 15:30 UTC (permalink / raw)
  To: Andrew Morton, linux-mm; +Cc: Andy Shevchenko

There is a place in the code where open-coded version of list_first_entry()
is used. Replace that with the standard macro.

While here, separate definitions from the code to avoid a churn by janitors.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 mm/dmapool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/dmapool.c b/mm/dmapool.c
index f9fb9bbd733e..049ac1459714 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -283,8 +283,8 @@ void dma_pool_destroy(struct dma_pool *pool)
 
 	while (!list_empty(&pool->page_list)) {
 		struct dma_page *page;
-		page = list_entry(pool->page_list.next,
-				  struct dma_page, page_list);
+
+		page = list_first_entry(&pool->page_list, struct dma_page, page_list);
 		if (is_page_busy(page)) {
 			if (pool->dev)
 				dev_err(pool->dev,
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-13 11:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 15:30 [PATCH v1] mm/dmapool.c: Replace open-coded list_first_entry() Andy Shevchenko
2020-08-12 18:41 ` Matthew Wilcox
2020-08-13 11:09   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).