From: Liam R. Howlett Date: Tue, 15 Oct 2019 18:40:48 +0000 (-0400) Subject: maple_tree: Update mas_start to return the entry on a single pointer X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cff55c752a8ef0dbc831fa89125a902a0f508d82;p=users%2Fjedix%2Flinux-maple.git maple_tree: Update mas_start to return the entry on a single pointer tree. mas_start returns: If mas->node is an error or MAS_START, return NULL If it's an empty tree: NULL & mas->node == MAS_NONE If it's a single entry: The entry & mas->node == MAS_ROOT If it's a tree: NULL & mas->node == safe root node. Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index f955ff9d01aa..3f2dc1b1d4f2 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -958,6 +958,7 @@ static inline struct maple_node *mas_node_cnt(struct ma_state *ms, int count) * Sets up maple state for operations by setting mas->min = 0 & mas->node to * certain values. * returns: + * - If mas->node is an error or MAS_START, return NULL. * - If it's an empty tree: NULL & mas->node == MAS_NONE * - If it's a single entry: The entry & mas->node == MAS_ROOT * - If it's a tree: NULL & mas->node == safe root node.