diff options
author | 2025-04-03 19:26:14 +0800 | |
---|---|---|
committer | 2025-05-11 17:54:04 -0700 | |
commit | 3dfd79cc8772bc2f02e060aa8c0bbbba8c1a1e45 (patch) | |
tree | 9b06cd161cb03017dc76398623d6a59ab2d5a71b /lib | |
parent | task_stack.h: remove obsolete __HAVE_ARCH_KSTACK_END check (diff) | |
download | linux-rng-3dfd79cc8772bc2f02e060aa8c0bbbba8c1a1e45.tar.xz linux-rng-3dfd79cc8772bc2f02e060aa8c0bbbba8c1a1e45.zip |
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/20250403112614.570140-1-johnny1001s000602@gmail.com
Signed-off-by: Chisheng Chen <johnny1001s000602@gmail.com>
Cc: Hsin Chang Yu <zxcvb600870024@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbtree.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rbtree.c b/lib/rbtree.c index 989c2d615f92..5114eda6309c 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); |