Skip to content

Remove four exported functions that nothing calls (-71) - #366

Closed
RyanTheTide wants to merge 1 commit into
mainfrom
deadweight/unused-c-functions
Closed

RyanTheTide wants to merge 1 commit into
mainfrom
deadweight/unused-c-functions

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

Four exported functions have no caller left:

function added why it is unused now
rtkit_quiesce_ap() (src/rtkit.c) f1118f8 (ewb, ANS AP quiesce before the Stage 1 hand-over) its only caller went away in adf5580, when post-M4 ANS moved to power-off after use and start from off
uartproxy_wait_dockchannel() (src/uartproxy.c) bf75ce3 its caller went away in 75665c7; uartproxy_wait_stage1() covers the DockChannel window
secboot_flavour() (src/secboot.c) f82845c never called; the flavour name is still published in the DT from flavour_name
stage1_proxy_action_needs_cleanup() (src/stage1_proxy.c) Stage 1 proxy window only the host test called it; main.c checks the payload action itself

Change

Remove the four functions and their prototypes, plus the test lines that called them or checked their source. rtkit_quiesce_ap_power() stays because the shutdown path uses it. The ordering test in test_stage1_proxy.py, which checks that CDC cleanup comes before a native hand-off, also stays. Net: -71 lines.

Testing

  • Clean builds on main 5c70a29 and on this branch in five configurations: dev, RELEASE=1 CHAINLOADING=1 (Stage 1), +ESP_STAGE2=1, SECBOOT=enforce SECBOOT_FLAVOUR=secure, and SPTM_VIRT=1 SPTM_VIRT_ESP=1 AURACTL=1. All link, image sizes are unchanged, and the warning lists match main's exactly in each configuration.
  • pytest tests/python: 746 passed, 2 failed, 27 skipped, the same as main (the 2 failures are test_loadobjs.py, where the buildbox's nm lists two symbols that share an address in the other order). The removed lines were assertions inside existing tests, so the test count is unchanged.

Still to run

No hardware row: none of these functions could be reached at runtime before the change.

Evidence
$ git grep -nw 'rtkit_quiesce_ap\|secboot_flavour\|uartproxy_wait_dockchannel\|stage1_proxy_action_needs_cleanup'   # main
src/rtkit.c:976  src/rtkit.h:29          (definition, prototype)
src/secboot.c:363  src/secboot.h:70
src/uartproxy.c:92  src/uartproxy.h:44   tests/python/test_wdt_boot_window.py:149 (reads the source text)
src/stage1_proxy.c:49  src/stage1_proxy.h:42  tests/python/test_stage1_proxy.py:27,28,47,85
$ git log --format='%h %s' -S 'rtkit_quiesce_ap(' | head -2
adf55805 nvme: power a post-M4 ANS off after use, and start it from off
f1118f85 nvme: quiesce ANS AP power before stage 1 hands the session on
  • No Rust or proxyclient caller: the proxy op tables don't name them.
  • None of the 90-odd open aura PRs references these symbols (checked each PR diff).
  • Build matrix, warning diff and pytest logs: traces/boot/20261120-deadweight-boot/ on the lab S500.
config main aura.bin bytes branch aura.bin bytes rc warnings main / branch
dev 3866624 3866624 0 12 / 12
Stage 1 release 1638400 1638400 0 12 / 12
ESP Stage 2 release 3997696 3997696 0 12 / 12
secure flavour, enforce 1507328 1507328 0 13 / 13
SPTM-virt ESP 3735552 3735552 0 12 / 12

Assisted-by: LLM (Claude:Opus 5.5)

- rtkit_quiesce_ap(): its only caller, the ANS hand-over quiesce,
  went away in adf5580 ("nvme: power a post-M4 ANS off after use,
  and start it from off"). rtkit_quiesce_ap_power() stays; the
  shutdown path still uses it.
- uartproxy_wait_dockchannel(): its caller was dropped in 75665c7
  ("boot: replace Neo build profiles with runtime USB selection");
  uartproxy_wait_stage1() covers the DockChannel window.
- secboot_flavour(): added with the Stage 1 flavours (f82845c) but
  never called. The flavour name is still published in the DT.
- stage1_proxy_action_needs_cleanup(): only the host test called it.
  main.c checks the payload action itself, and the ordering test in
  test_stage1_proxy.py still guards the CDC cleanup before a native
  handoff.

Drop the matching test lines.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Folded into #371 together with the other removals, one commit per set.

@RyanTheTide
RyanTheTide deleted the deadweight/unused-c-functions branch November 19, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant