From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1] mm/dmapool.c: Replace open-coded list_first_entry()
Date: Wed, 12 Aug 2020 18:30:59 +0300 [thread overview]
Message-ID: <20200812153059.51089-1-andriy.shevchenko@linux.intel.com> (raw)
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
next reply other threads:[~2020-08-12 15:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-12 15:30 Andy Shevchenko [this message]
2020-08-12 18:41 ` [PATCH v1] mm/dmapool.c: Replace open-coded list_first_entry() Matthew Wilcox
2020-08-13 11:09 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200812153059.51089-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).