linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] fs: use LIST_HEAD() to simplify code
@ 2024-08-21  6:54 Hongbo Li
  2024-08-28  9:28 ` Jan Kara
  2024-08-28 11:20 ` Christian Brauner
  0 siblings, 2 replies; 3+ messages in thread
From: Hongbo Li @ 2024-08-21  6:54 UTC (permalink / raw)
  To: viro, brauner, jack; +Cc: lihongbo22, linux-fsdevel

list_head can be initialized automatically with LIST_HEAD()
instead of calling INIT_LIST_HEAD().

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

diff --git a/fs/buffer.c b/fs/buffer.c
index e55ad471c530..31a9062cad7e 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -774,12 +774,11 @@ EXPORT_SYMBOL(block_dirty_folio);
 static int fsync_buffers_list(spinlock_t *lock, struct list_head *list)
 {
 	struct buffer_head *bh;
-	struct list_head tmp;
 	struct address_space *mapping;
 	int err = 0, err2;
 	struct blk_plug plug;
+	LIST_HEAD(tmp);
 
-	INIT_LIST_HEAD(&tmp);
 	blk_start_plug(&plug);
 
 	spin_lock(lock);
-- 
2.34.1


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

end of thread, other threads:[~2024-08-28 11:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21  6:54 [PATCH -next] fs: use LIST_HEAD() to simplify code Hongbo Li
2024-08-28  9:28 ` Jan Kara
2024-08-28 11:20 ` Christian Brauner

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).