Skip to content

Commit 3dfd79c

Browse files
rota1001akpm00
authored andcommitted
lib/rbtree.c: fix the example typo
Replace `sr` with `Sr`. The condition `!tmp1 || rb_is_black(tmp1)` ensures that `tmp1` (which is `sibling->rb_right`) is either NULL or a black node. Therefore, the right child of the sibling must be black, and the example should use `Sr` instead of `sr`. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Chisheng Chen <[email protected]> Cc: Hsin Chang Yu <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent db80bd2 commit 3dfd79c

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)