ksm: swap the two output parameters of chain/chain_prune
Some static checker complains if chain/chain_prune returns a potentially
stale pointer.
There are two output parameters to chain/chain_prune, one is tree_page
the other is stable_node_dup. Like in get_ksm_page the caller has to
check tree_page is NULL before touching the stable_node. Similarly in
chain/chain_prune the caller has to check tree_page before touching the
stable_node_dup returned or the original stable_node passed as
parameter.
Because the tree_page is never returned as a stale pointer, it may be
more intuitive to return tree_page and to pass stable_node_dup for
reference instead of the reverse.
This patch purely swaps the two output parameters of chain/chain_prune
as a cleanup for the static checker and to mimic the get_ksm_page
behavior more closely. There's no change to the caller at all except
the swap, it's purely a cleanup and it is a noop from the caller point
of view.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Andrea Arcangeli <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Tested-by: Dan Carpenter <[email protected]>
Cc: Evgheni Dereveanchin <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Petr Holasek <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Arjan van de Ven <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Gavin Guo <[email protected]>
Cc: Jay Vosburgh <[email protected]>
Cc: Mel Gorman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>