Skip to contentSkip to conversation

Documentation/rbtree.txt: cleanup kerneldoc of rbtree.txt

PATCH RESEND Jiri Kosina 1 participant 1 message May 5, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1239937128.3355.11.camel@myhost

#1 lore raw
Quoted 27 lines · figo.zhang

The first formal parameter of the rb_link_node() is a pointer, and the "node" is define a data struct (pls see line 67 and line 73 in the doc), so the actual parameter should use "&data->node".

---
 Documentation/rbtree.txt |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
Documentation/rbtree.txt +2 -2
index 7224459..7710214 100644
@@ -131,8 +131,8 @@ Example:
   	}
 
   	/* Add new node and rebalance tree. */
-  	rb_link_node(data->node, parent, new);
-  	rb_insert_color(data->node, root);
+  	rb_link_node(&data->node, parent, new);
+  	rb_insert_color(&data->node, root);
 
 	return TRUE;
   }
@@ -146,10 +146,10 @@ To remove an existing node from a tree, call:
 
 Example:

Documentation/rbtree.txt To remove an existing node from a tree, call: · line 155

Quoted 10 lines
Documentation/rbtree.txt +2 -2
 
-  struct mytype *data = mysearch(mytree, "walrus");
+  struct mytype *data = mysearch(&mytree, "walrus");
 
   if (data) {
-  	rb_erase(data->node, mytree);
+  	rb_erase(&data->node, &mytree);
   	myfree(data);
   }
 

Didn't find it in today's linux-next pileup, so I have applied it to trivial tree. Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs