Skip to contentSkip to conversation

doc/rbtree: fix inserting example

PATCH In review Marcin Slusarz 2 participants 3 messages Aug 23, 2009 – Aug 25, 2009 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc/rbtree: fix inserting example

rb_link_node and rb_insert_color take pointer to struct rb_node as a first parameter, but example code passes plain struct rb_node. Fix it.

Cc Rob Landley <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Andrew Morton <[email protected]>
---
 Documentation/rbtree.txt |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Documentation/rbtree.txt +2 -2
index 7224459..b67a87e 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;
   }
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 3 lines · On Sun, 23 Aug 2009 20:34:23 +0200 Marcin Slusarz wrote:

rb_link_node and rb_insert_color take pointer to struct rb_node as a first parameter, but example code passes plain struct rb_node. Fix it.

This is already corrected in the mainline kernel tree, right?

Quoted 13 lines
Cc Rob Landley <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Andrew Morton <[email protected]>
---
 Documentation/rbtree.txt |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Documentation/rbtree.txt +0 -0
index 7224459..b67a87e 100644

Documentation/rbtree.txt Example: · line 138

Quoted 10 lines
Documentation/rbtree.txt +2 -2
@@ -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;
   }

---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/

#2 lore raw
Quoted 7 lines · Randy Dunlap
Quoted 3 lines · On Sun, 23 Aug 2009 20:34:23 +0200 Marcin Slusarz wrote:

rb_link_node and rb_insert_color take pointer to struct rb_node as a first parameter, but example code passes plain struct rb_node. Fix it.

This is already corrected in the mainline kernel tree, right?

yes, sorry for bothering

Marcin