Skip to content

Commit

Permalink
lib/rbtree.c: fix the example typo
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Hsin Chang Yu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
marsh-fish authored and akpm00 committed Jul 5, 2024
1 parent 255547c commit cedb08c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit cedb08c

Please sign in to comment.