From 98666f8a2576b12f5f3ebcef61a8cdbefede1be3 Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Thu, 5 Nov 2015 18:49:13 -0800 Subject: ksm: use the helper method to do the hlist_empty check This just uses the helper function to cleanup the assumption on the hlist_node internals. Signed-off-by: Andrea Arcangeli Acked-by: Hugh Dickins Cc: Petr Holasek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/ksm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mm') diff --git a/mm/ksm.c b/mm/ksm.c index 9f182f99ff5e..d4ee1591520b 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -625,7 +625,7 @@ static void remove_rmap_item_from_tree(struct rmap_item *rmap_item) unlock_page(page); put_page(page); - if (stable_node->hlist.first) + if (!hlist_empty(&stable_node->hlist)) ksm_pages_sharing--; else ksm_pages_shared--; -- cgit