Skip to content

Commit 6adf4b1

Browse files
murphy12138tehcaster
authored andcommitted
mm: simplify list initialization in barn_shrink()
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>
1 parent 4c0a17e commit 6adf4b1

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

mm/slub.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3032,14 +3032,11 @@ static void barn_init(struct node_barn *barn)
30323032

30333033
static void barn_shrink(struct kmem_cache *s, struct node_barn *barn)
30343034
{
3035-
struct list_head empty_list;
3036-
struct list_head full_list;
3035+
LIST_HEAD(empty_list);
3036+
LIST_HEAD(full_list);
30373037
struct slab_sheaf *sheaf, *sheaf2;
30383038
unsigned long flags;
30393039

3040-
INIT_LIST_HEAD(&empty_list);
3041-
INIT_LIST_HEAD(&full_list);
3042-
30433040
spin_lock_irqsave(&barn->lock, flags);
30443041

30453042
list_splice_init(&barn->sheaves_full, &full_list);

0 commit comments

Comments
 (0)