diff options
Diffstat (limited to 'Documentation/rbtree.txt')
-rw-r--r-- | Documentation/rbtree.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Documentation/rbtree.txt b/Documentation/rbtree.txt index 7224459b469e..aae8355d3166 100644 --- a/Documentation/rbtree.txt +++ b/Documentation/rbtree.txt | |||
@@ -131,8 +131,8 @@ Example: | |||
131 | } | 131 | } |
132 | 132 | ||
133 | /* Add new node and rebalance tree. */ | 133 | /* Add new node and rebalance tree. */ |
134 | rb_link_node(data->node, parent, new); | 134 | rb_link_node(&data->node, parent, new); |
135 | rb_insert_color(data->node, root); | 135 | rb_insert_color(&data->node, root); |
136 | 136 | ||
137 | return TRUE; | 137 | return TRUE; |
138 | } | 138 | } |
@@ -146,10 +146,10 @@ To remove an existing node from a tree, call: | |||
146 | 146 | ||
147 | Example: | 147 | Example: |
148 | 148 | ||
149 | struct mytype *data = mysearch(mytree, "walrus"); | 149 | struct mytype *data = mysearch(&mytree, "walrus"); |
150 | 150 | ||
151 | if (data) { | 151 | if (data) { |
152 | rb_erase(data->node, mytree); | 152 | rb_erase(&data->node, &mytree); |
153 | myfree(data); | 153 | myfree(data); |
154 | } | 154 | } |
155 | 155 | ||
@@ -188,5 +188,5 @@ Example: | |||
188 | 188 | ||
189 | struct rb_node *node; | 189 | struct rb_node *node; |
190 | for (node = rb_first(&mytree); node; node = rb_next(node)) | 190 | for (node = rb_first(&mytree); node; node = rb_next(node)) |
191 | printk("key=%s\n", rb_entry(node, int, keystring)); | 191 | printk("key=%s\n", rb_entry(node, struct mytype, node)->keystring); |
192 | 192 | ||