Repository navigation
apple: remove exported functions with no caller (-145) - #2369
RyanTheTide wants to merge 6 commits into
Conversation
apple_dart_m5_restore() came in with the T6050 suspend-to-RAM work (5ce3491) without a caller, and nothing has called it since. The firmware 27 display sleep restores its DARTs through the v27 lease (apple-dart-v27-late.inc). Nothing ever writes the fields the function restores (m5_streams, m5_gapf, m5_diag, m5_error_mask, m5_protect, m5_lock), and m5_changed is only ever cleared, so even with a caller it would have restored zeros. Remove the function, its declaration and stub, and the fields only it used. m5_sleep_owner, m5_disp_streams and m5_display stay; the v27 code uses them. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The dwc3 glue finishes a sleep with apple_atcphy_sleep_finish_async() and polls apple_atcphy_sleep_finish_done() since a667121 ("usb: dwc3: apple: keep USB teardown out of the PM notifier chain"). That removed the last caller of apple_atcphy_sleep_finish() and apple_atcphy_sleep_finish_flush(). Remove both exports and their stubs. The static atcphy_sleep_finish() stays; the finish work runs it. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
macsmc registers its sleep notices through apple_sleep_smc_register_saved(), which takes the full ops table. Nothing calls the older apple_sleep_smc_register(), which only took the late notice and refused to run once saved ops were registered. Remove it and its stub. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
No driver frees a devm RTKit instance early: nothing in the tree, C or Rust, calls devm_apple_rtkit_free(). Remove it. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
apple_pmp_j713_gpu_check() was added beside the GPU prepare and get helpers but has never had a caller. Remove it; pmp_power_check() keeps its display callers. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
isp_firmware_boot_stage1() carries an #if 0 block that reset the coprocessor only when a GPIO word read back a marker, disabled because it did not work well with system sleep. The unconditional isp_reset_coproc() right after it replaced it. Drop the block and the commented-out variable it needed. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
No blockers. All six removed exports and the nine Assisted-by: LLM (Claude:Opus 5.5) |
|
One problem found by checking open PRs against this removal; everything else holds at the current integration/aurora (the branch still merges cleanly and every removed symbol has no reference left in the merged tree).
The other four removals ( Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR review at verified live head 5996b85e1212f26c581e95b7f1a7cf16bbcefd3e against live integration/aurora (70a00e583b03, not superseded).
Verified Clean
- Caller & dead-helper audit on live
integration/aurora(70a00e583b03): All six removed exports (apple_dart_m5_restoreplus its 9 unread/unwrittenm5_*fields instruct apple_dart,apple_atcphy_sleep_finish,apple_atcphy_sleep_finish_flush,apple_sleep_smc_register,devm_apple_rtkit_free,apple_pmp_j713_gpu_check) and the#if 0block indrivers/media/platform/apple/isp/isp-fw.chave zero callers on liveintegration/aurora. All retained helpers (apple_dart_state_retained,apple_dart_m5_streams_unownedinapple-dart-v27-late.inc:384,apple_rtkit_free_wrapper,pmp_power_check,s->smc.late_notice) keep active callers. - Attribution (§4): All 6 commits carry human author/committer and human
Signed-off-by:only (zero AI commit trailers); PR body discloses assistance.
Blockers Before APPROVE
- Unresolved silent build breakage with open PR #2215 (
7e229ab510a7, non-draft):- Verified on live #2215: it adds
static inlinewrappersapple_typec_phy_sleep_finish()andapple_typec_phy_sleep_finish_flush()toinclude/linux/phy/apple-atc.hcallingapple_atcphy_sleep_finish()andapple_atcphy_sleep_finish_flush(). - Because the edits land in non-overlapping regions of
include/linux/phy/apple-atc.h, a 3-way merge of #2369 and #2215 produces no textual conflict and fails to compile every translation unit that includes<linux/phy/apple-atc.h>. - Please either drop commit
6090c7283e84(phy: apple: atc: remove the synchronous sleep finish and its flush) from #2369 or update #2215 to remove those unused wrappers first.
- Verified on live #2215: it adds
- §6 Stale base / missing live CI coverage:
- Head
5996b85e1212is still based on0abc2f385e54(2026-11-19). Liveintegration/auroraadded.github/workflows/pmgr-pwrstate-kunit.ymlon2026-11-23(triggered byinclude/linux/soc/apple/**, which this PR modifies), and it has not run on this head. - Please rebase/merge onto live
integration/aurora(70a00e583b03) sopmgr-pwrstate-kunit,sep-source, andhost-testsall run green against the current tree.
- Head
Non-Blocking Note
include/linux/soc/apple/sleep.hlines 40–46 are adjacent to PR #2384's edits; keep merge-train ordering in mind once both are ready.
Assisted-by: LLM (Gemini 4 Neon)
Problem
Several exported functions in our Apple drivers have no caller anywhere in the tree (C or Rust). Most are the first version of an interface that a second version replaced. There is also one
#if 0block.Change
Six commits, one per subsystem, net -145 lines, no functional change:
apple_dart_m5_restore()and the fields only it read. It came in with the T6050 S2R work (5ce3491) without a caller; the v27 lease replaced it. Nothing ever wrote those fields, so it would have restored zeros.apple_atcphy_sleep_finish()and_finish_flush(). dwc3-apple uses only_finish_async()/_finish_done()since a667121.apple_sleep_smc_register(). macsmc usesapple_sleep_smc_register_saved().devm_apple_rtkit_free(), which has no user.apple_pmp_j713_gpu_check(), which has had no user since it was added (1ae4d49).#if 0conditional coprocessor reset. The unconditionalisp_reset_coproc()after it replaced it.Not included:
typec_mux_prepare()has no in-kernel caller, but the host testtools/testing/selftests/drivers/gpu/apple-dcp/quiesce.pyexercises it.Testing
make Image modules dtbsRC=0, 5,909 modules, modpost reports no undefined symbols, and the only warnings are ones the baseline already had in untouched files.make prepare+W=1single-object builds before and after: apple-dart.o, atc.o, sleep.o, rtkit.o, pmp-display.o, isp-fw.o and dcp.o, plus the callers macsmc.o and dwc3-apple.o. RC=0, no new warnings.git grep -n -w <symbol>on 0abc2f3 finds only each function's definition, its export, its header prototype and its stub.Still to run
Nothing build-side.
Caller grep per symbol
Assisted-by: LLM (Claude:Opus 5.5)