From: Andrea Arcangeli Date: Fri, 6 Nov 2015 02:49:13 +0000 (-0800) Subject: ksm: use the helper method to do the hlist_empty check X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=98666f8a2576b12f5f3ebcef61a8cdbefede1be3;p=deliverable%2Flinux.git 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 --- 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--;