android_kernel_xiaomi_sm8350/lib
David Woodhouse 1975e59375 [RBTREE] Remove dead code in rb_erase()
Observe rb_erase(), when the victim node 'old' has two children so
neither of the simple cases at the beginning are taken.

Observe that it effectively does an 'rb_next()' operation to find the
next (by value) node in the tree. That is; we go to the victim's
right-hand child and then follow left-hand pointers all the way
down the tree as far as we can until we find the next node 'node'. We
end up with 'node' being either the same immediate right-hand child of
'old', or one of its descendants on the far left-hand side.

For a start, we _know_ that 'node' has a parent. We can drop that check.

We also know that if 'node's parent is 'old', then 'node' is the
right-hand child of its parent. And that if 'node's parent is _not_
'old', then 'node' is the left-hand child of its parent.

So instead of checking for 'node->rb_parent == old' in one place and
also checking 'node's heritage separately when we're trying to change
its link from its parent, we can shuffle things around a bit and do
it like this...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-04-21 13:30:36 +01:00
..
reed_solomon [PATCH] sem2mutex: kernel/ 2006-03-23 07:38:10 -08:00
zlib_deflate
zlib_inflate
.gitignore
bitmap.c [PATCH] bitops: hweight() related cleanup 2006-03-26 08:57:15 -08:00
bust_spinlocks.c
cmdline.c
cpumask.c [PATCH] cpumask: uninline any_online_cpu() 2006-03-25 08:23:00 -08:00
crc16.c
crc32.c
crc32defs.h
crc-ccitt.c
ctype.c
dec_and_lock.c
div64.c
dump_stack.c
errno.c
extable.c [PATCH] powerpc: trivial: modify comments to refer to new location of files 2006-02-10 16:53:51 +11:00
find_next_bit.c [PATCH] bitops: generic ext2_{set,clear,test,find_first_zero,find_next_zero}_bit() 2006-03-26 08:57:11 -08:00
gen_crc32table.c
genalloc.c
halfmd4.c
hweight.c [PATCH] bitops: hweight() speedup 2006-03-26 08:59:30 -08:00
idr.c
inflate.c
int_sqrt.c [PATCH] lib: Fix bug in int_sqrt() for 64 bit longs 2006-02-03 08:32:08 -08:00
iomap_copy.c [PATCH] iomap_copy fallout (m68k) 2006-02-18 16:30:40 -05:00
iomap.c
Kconfig
Kconfig.debug [PATCH] Kconfig.debug: Set DEBUG_MUTEX to off by default 2006-04-19 09:13:51 -07:00
kernel_lock.c
klist.c
kobject_uevent.c [PATCH] kobject: fix build error if CONFIG_SYSFS=n 2006-03-20 13:42:57 -08:00
kobject.c [PATCH] sysfs: Allow sysfs attribute files to be pollable 2006-04-14 11:41:24 -07:00
kref.c [PATCH] kref: avoid an atomic operation in kref_put() 2006-03-20 13:42:57 -08:00
libcrc32c.c
Makefile [PATCH] bitops: generic hweight{64,32,16,8}() 2006-03-26 08:57:11 -08:00
parser.c
prio_tree.c
radix-tree.c [PATCH] radix-tree documentation cleanups 2006-03-25 08:22:59 -08:00
rbtree.c [RBTREE] Remove dead code in rb_erase() 2006-04-21 13:30:36 +01:00
rwsem-spinlock.c
rwsem.c
semaphore-sleepers.c
sha1.c
smp_processor_id.c
sort.c
spinlock_debug.c [PATCH] Fix spinlock debugging delays to not time out too early 2006-02-07 16:12:33 -08:00
string.c [PATCH] Silence a const vs non-const warning 2006-04-11 06:18:42 -07:00
swiotlb.c BUG_ON() Conversion in lib/swiotlb.c 2006-03-24 18:47:11 +01:00
textsearch.c
ts_bm.c
ts_fsm.c
ts_kmp.c
vsprintf.c