]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: use LIST_HEAD() to simplify code
authorHongbo Li <lihongbo22@huawei.com>
Wed, 21 Aug 2024 06:43:55 +0000 (14:43 +0800)
committerChandan Babu R <chandanbabu@kernel.org>
Tue, 3 Sep 2024 04:37:42 +0000 (10:07 +0530)
list_head can be initialized automatically with LIST_HEAD()
instead of calling INIT_LIST_HEAD().

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/xfs_mru_cache.c

index 7443debaffd65aeeba54438e3df6fa45cbbc8354..d0f5b403bdbebc948048e42cd0958b188c62ed90 100644 (file)
@@ -230,9 +230,8 @@ _xfs_mru_cache_clear_reap_list(
                __releases(mru->lock) __acquires(mru->lock)
 {
        struct xfs_mru_cache_elem *elem, *next;
-       struct list_head        tmp;
+       LIST_HEAD(tmp);
 
-       INIT_LIST_HEAD(&tmp);
        list_for_each_entry_safe(elem, next, &mru->reap_list, list_node) {
 
                /* Remove the element from the data store. */