Skip to content

Commit cedb08c

Browse files
marsh-fishakpm00
authored andcommitted
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/[email protected] Signed-off-by: Hsin Chang Yu <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 255547c commit cedb08c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/rbtree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ ____rb_erase_color(struct rb_node *parent, struct rb_root *root,
297297
* / \ / \
298298
* N S --> N sl
299299
* / \ \
300-
* sl Sr S
300+
* sl sr S
301301
* \
302-
* Sr
302+
* sr
303303
*
304304
* Note: p might be red, and then both
305305
* p and sl are red after rotation(which
@@ -312,9 +312,9 @@ ____rb_erase_color(struct rb_node *parent, struct rb_root *root,
312312
* / \ / \
313313
* N sl --> P S
314314
* \ / \
315-
* S N Sr
315+
* S N sr
316316
* \
317-
* Sr
317+
* sr
318318
*/
319319
tmp1 = tmp2->rb_right;
320320
WRITE_ONCE(sibling->rb_left, tmp1);

0 commit comments

Comments
 (0)