diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-11 11:44:59 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-11 12:42:27 -0700 |
| commit | f4ae215f0a9319207984a9a1ab6c5eb9f56cec0c (patch) | |
| tree | fb5daec545e20537d89097b85e06688ce5547515 /scripts/Makefile.thinlto | |
| parent | 970ec680434442a4266cf34cf6386e3cfaaf85ae (diff) | |
| download | linux-next-f4ae215f0a9319207984a9a1ab6c5eb9f56cec0c.tar.gz linux-next-f4ae215f0a9319207984a9a1ab6c5eb9f56cec0c.zip | |
assoc_array: find and collapse in deletion without gotos
Finding the leaf to delete is a switch whose one useful case falls
through into the cases that give up, and is left by a goto to
found_leaf. Make it an if, and a loop that stops at the leaf.
The climb to the highest node the collapse can merge into is two
labels, collapse_up and do_collapse. Make it a for loop that stops at
the root or at a node with too many leaves. The new node's place is
found with assoc_array_parent_link(), keeping the check against a leaf
as a back pointer as a BUG_ON(), and the cleanup after a failed
allocation moves to the one place that needs it.
There is no recursion, and assoc_array_delete()'s stack frame is 160
bytes against 176 before, on an x86-64 defconfig.
No functional change.
Assisted-by: LLM
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
