linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hongbo Li <lihongbo22@huawei.com>
To: <akpm@linux-foundation.org>, <urezki@gmail.com>, <hch@infradead.org>
Cc: <linux-mm@kvack.org>, <lihongbo22@huawei.com>
Subject: [PATCH -next] mm: make use of the helper macro LIST_HEAD()
Date: Tue, 27 Aug 2024 09:57:24 +0800	[thread overview]
Message-ID: <20240827015724.620110-1-lihongbo22@huawei.com> (raw)

list_head can be initialized automatically with LIST_HEAD()
instead of calling INIT_LIST_HEAD(). Here we can simplify
the code.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
---
 mm/vmalloc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 3f9b6bd707d2..3f7b38481fcc 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2141,13 +2141,11 @@ decay_va_pool_node(struct vmap_node *vn, bool full_decay)
 	INIT_LIST_HEAD(&decay_list);
 
 	for (i = 0; i < MAX_VA_SIZE_PAGES; i++) {
-		struct list_head tmp_list;
+		LIST_HEAD(tmp_list);
 
 		if (list_empty(&vn->pool[i].head))
 			continue;
 
-		INIT_LIST_HEAD(&tmp_list);
-
 		/* Detach the pool, so no-one can access it. */
 		spin_lock(&vn->pool_lock);
 		list_replace_init(&vn->pool[i].head, &tmp_list);
-- 
2.34.1



             reply	other threads:[~2024-08-27  1:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27  1:57 Hongbo Li [this message]
2024-08-27 19:22 ` Uladzislau Rezki
2024-08-28  1:27   ` Hongbo Li

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=20240827015724.620110-1-lihongbo22@huawei.com \
    --to=lihongbo22@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=urezki@gmail.com \
    /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