]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ksm: unstable_tree_search_insert error checking cleanup
authorAndrea Arcangeli <aarcange@redhat.com>
Wed, 21 Oct 2015 22:03:16 +0000 (09:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Oct 2015 22:03:16 +0000 (09:03 +1100)
get_mergeable_page() can only return NULL (in case of errors) or the
pinned mergeable page.  It can't return an error different than NULL.
This makes it more readable and less confusion in addition to optimizing
the check.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Petr Holasek <pholasek@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/ksm.c

index 10618a36abb0b19e70cdeaf78fcff867092c0a15..dcefc371fc628bdd6f9f50528e254a4d785b3854 100644 (file)
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1409,7 +1409,7 @@ struct rmap_item *unstable_tree_search_insert(struct rmap_item *rmap_item,
                cond_resched();
                tree_rmap_item = rb_entry(*new, struct rmap_item, node);
                tree_page = get_mergeable_page(tree_rmap_item);
-               if (IS_ERR_OR_NULL(tree_page))
+               if (!tree_page)
                        return NULL;
 
                /*