projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
255547c
)
lib/rbtree.c: fix the example typo
author
Hsin Chang Yu
<zxcvb600870024@gmail.com>
Fri, 28 Jun 2024 14:22:29 +0000
(22:22 +0800)
committer
Andrew Morton
<akpm@linux-foundation.org>
Fri, 5 Jul 2024 06:43:10 +0000
(23:43 -0700)
Replace the "Sr" with "sr", the example is wrong if sl and N don't have
child nodes, so sr should be red node.
Link:
https://lkml.kernel.org/r/20240628142229.69419-1-zxcvb600870024@gmail.com
Signed-off-by: Hsin Chang Yu <zxcvb600870024@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/rbtree.c
patch
|
blob
|
history
diff --git
a/lib/rbtree.c
b/lib/rbtree.c
index
5114eda
..
989c2d6
100644
(file)
--- a/
lib/rbtree.c
+++ b/
lib/rbtree.c
@@
-297,9
+297,9
@@
____rb_erase_color(struct rb_node *parent, struct rb_root *root,
* / \ / \
* N S --> N sl
* / \ \
- * sl
S
r S
+ * sl
s
r S
* \
- *
S
r
+ *
s
r
*
* Note: p might be red, and then both
* p and sl are red after rotation(which
@@
-312,9
+312,9
@@
____rb_erase_color(struct rb_node *parent, struct rb_root *root,
* / \ / \
* N sl --> P S
* \ / \
- * S N
S
r
+ * S N
s
r
* \
- *
S
r
+ *
s
r
*/
tmp1 = tmp2->rb_right;
WRITE_ONCE(sibling->rb_left, tmp1);