]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm: simplify list initialization in barn_shrink()
authorBaolin Liu <liubaolin@kylinos.cn>
Tue, 11 Nov 2025 12:22:05 +0000 (20:22 +0800)
committerVlastimil Babka <vbabka@suse.cz>
Thu, 13 Nov 2025 09:32:19 +0000 (10:32 +0100)
In barn_shrink(), use LIST_HEAD() to declare and initialize the
list_head in one step instead of using INIT_LIST_HEAD() separately.

No functional change.

Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slub.c

index f729c208965b73d47db37e7af4545d947d89d8b2..72eeeefd0a89ab35c3a46a6f82d6762aab1c338d 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3032,14 +3032,11 @@ static void barn_init(struct node_barn *barn)
 
 static void barn_shrink(struct kmem_cache *s, struct node_barn *barn)
 {
-       struct list_head empty_list;
-       struct list_head full_list;
+       LIST_HEAD(empty_list);
+       LIST_HEAD(full_list);
        struct slab_sheaf *sheaf, *sheaf2;
        unsigned long flags;
 
-       INIT_LIST_HEAD(&empty_list);
-       INIT_LIST_HEAD(&full_list);
-
        spin_lock_irqsave(&barn->lock, flags);
 
        list_splice_init(&barn->sheaves_full, &full_list);