[PATCH 05/14] mm/ksm: make remove_stable_node_chain() return bool

From: Longlong Xia

Date: Tue Sep 15 2026 - 11:15:46 EST


From: Longlong Xia <xialonglong@xxxxxxxxxx>

remove_stable_node_chain() only returns true or false. Use bool and
return remove_stable_node() directly in the non-chain case.

No functional change intended.

Assisted-by: Zcode:GLM-5.3
Signed-off-by: Longlong Xia <xialonglong@xxxxxxxxxx>

---
mm/ksm.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/mm/ksm.c b/mm/ksm.c
index aa33522627c7..99f0bd3a1ae3 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1177,18 +1177,15 @@ static int remove_stable_node(struct ksm_stable_node *stable_node)
return err;
}

-static int remove_stable_node_chain(struct ksm_stable_node *stable_node,
- struct rb_root *root)
+static bool remove_stable_node_chain(struct ksm_stable_node *stable_node,
+ struct rb_root *root)
{
struct ksm_stable_node *dup;
struct hlist_node *hlist_safe;

if (!is_stable_node_chain(stable_node)) {
VM_BUG_ON(is_stable_node_dup(stable_node));
- if (remove_stable_node(stable_node))
- return true;
- else
- return false;
+ return remove_stable_node(stable_node);
}

hlist_for_each_entry_safe(dup, hlist_safe,
--
2.43.0