summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHsin Chang Yu <zxcvb600870024@gmail.com>2024-06-28 22:22:29 +0800
committerAndrew Morton <akpm@linux-foundation.org>2024-07-04 23:43:10 -0700
commitcedb08caac587b55c79d0463400839acab4638c0 (patch)
tree9b678230cf776b4d1797779048344db5c95e94ed /lib
parent255547c6bb8940a97eea94ef9d464ea5967763fb (diff)
lib/rbtree.c: fix the example typo
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/rbtree.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rbtree.c b/lib/rbtree.c
index 5114eda6309c..989c2d615f92 100644
--- 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 Sr S
+ * sl sr S
* \
- * Sr
+ * sr
*
* 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 Sr
+ * S N sr
* \
- * Sr
+ * sr
*/
tmp1 = tmp2->rb_right;
WRITE_ONCE(sibling->rb_left, tmp1);