From: Hongbo Li Date: Wed, 21 Aug 2024 06:54:56 +0000 (+0800) Subject: fs: use LIST_HEAD() to simplify code X-Git-Tag: v6.12-rc1~215^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=73ce1c9fce70ec6f1fcfaf3da51d0b58368b44f3;p=thirdparty%2Fkernel%2Flinux.git fs: use LIST_HEAD() to simplify code list_head can be initialized automatically with LIST_HEAD() instead of calling INIT_LIST_HEAD(). Signed-off-by: Hongbo Li Link: https://lore.kernel.org/r/20240821065456.2294216-1-lihongbo22@huawei.com Reviewed-by: Jan Kara Signed-off-by: Christian Brauner --- diff --git a/fs/buffer.c b/fs/buffer.c index e55ad471c5306..31a9062cad7ed 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);