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-13 09:44:51 -0700 |
| commit | 2dafc9bc491da8146bf293a93ae21fd68755e370 (patch) | |
| tree | 78bd8713c754937c1e0bc8e4dd28e71872748184 /scripts/Makefile.thinlto | |
| parent | 4a5db94ad9b763d3b9d5dc0cad2241f5b9dd4f22 (diff) | |
| download | linux-next-2dafc9bc491da8146bf293a93ae21fd68755e370.tar.gz linux-next-2dafc9bc491da8146bf293a93ae21fd68755e370.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>
Tested-by: David Howells <dhowells@redhat.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
