From 27af1da4b58675d5c6bacf9b7de9c2746687d272 Mon Sep 17 00:00:00 2001 From: "figo.zhang" Date: Fri, 17 Apr 2009 10:58:48 +0800 Subject: trivial: Documentation/rbtree.txt: cleanup kerneldoc of rbtree.txt 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". Signed-off-by: Figo.zhang Signed-off-by: Jiri Kosina --- Documentation/rbtree.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Documentation/rbtree.txt') diff --git a/Documentation/rbtree.txt b/Documentation/rbtree.txt index 7224459b..7710214 100644 --- a/Documentation/rbtree.txt +++ b/Documentation/rbtree.txt @@ -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: - 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); } -- cgit v1.1 From 190342335c2a7939407d7391e5bb6c9ee39244eb Mon Sep 17 00:00:00 2001 From: Wang Tinggong Date: Thu, 14 May 2009 11:00:20 +0200 Subject: trivial: rbtree.txt: fix rb_entry() parameters in sample code Reviewed-by: WANG Cong Signed-off-by: Jiri Kosina --- Documentation/rbtree.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/rbtree.txt') diff --git a/Documentation/rbtree.txt b/Documentation/rbtree.txt index 7710214..aae8355 100644 --- a/Documentation/rbtree.txt +++ b/Documentation/rbtree.txt @@ -188,5 +188,5 @@ Example: struct rb_node *node; for (node = rb_first(&mytree); node; node = rb_next(node)) - printk("key=%s\n", rb_entry(node, int, keystring)); + printk("key=%s\n", rb_entry(node, struct mytype, node)->keystring); -- cgit v1.1