2023-06-27 12:22:46

by mawupeng

[permalink] [raw]
Subject: [PATCH 1/2] swap: Cleanup duplicated WARN_ON in add_to_avail_list

From: Ma Wupeng <[email protected]>

Empty check for plist_node is checked in add_to_avail_list and plist_add.
Drop the duplicate one in add_to_avail_list.

Signed-off-by: Ma Wupeng <[email protected]>
---
mm/swapfile.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 274bbf797480..879cb80bf37b 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -713,10 +713,8 @@ static void add_to_avail_list(struct swap_info_struct *p)
int nid;

spin_lock(&swap_avail_lock);
- for_each_node(nid) {
- WARN_ON(!plist_node_empty(&p->avail_lists[nid]));
+ for_each_node(nid)
plist_add(&p->avail_lists[nid], &swap_avail_heads[nid]);
- }
spin_unlock(&swap_avail_lock);
}

--
2.25.1