Repository navigation
platform: remove headers that are compiled out for their platforms - #11534
Merged
lgirdwood merged 3 commits intoNov 25, 2026
Merged
Conversation
On Zephyr, platform/drivers/interrupt.h is only included through rtos/interrupt-legacy.h, which only the AMD platforms without native drivers use, and the host build uses the library platform copy. The i.MX8, i.MX8M, i.MX8ULP and posix copies are never included. Remove them. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
platform/lib/dai.h is only included through sof/lib/dai-legacy.h, which the Zephyr sof/lib/dai.h only uses without CONFIG_ZEPHYR_NATIVE_DRIVERS. All the i.MX and qemu_xtensa boards use the native drivers, and SOF has no legacy DAI drivers for them, so their copies are never included. Remove them. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The Zephyr sof/lib/dma.h only includes platform/lib/dma.h for the legacy DMA domain schedulers (CONFIG_SCHEDULE_DMA_SINGLE_CHANNEL and CONFIG_SCHEDULE_DMA_MULTI_CHANNEL), which only Rembrandt and MediaTek without native drivers select, and the host build uses the library platform copy. The i.MX, posix and qemu_xtensa copies are never included. Remove them. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
lgirdwood
marked this pull request as ready for review
November 25, 2026 13:00
lgirdwood
requested review from
dbaluta,
kv2019i,
lbetlej,
mmaka1 and
plbossart
as code owners
November 25, 2026 13:00
PR 11534: test resultsRun date: 2026-11-25 14:52 UTC Tested commit: a093f487a8b2a8e6b3666b21794e8db856006f5f |
Member
Author
|
Dead code removal. CI unrelated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove 17 platform headers (597 lines) that are only reachable through includes that are compiled out for their platforms. This is the fourth part of the platform header cleanup in #11517 step 1, after #11528, #11529 and #11532.
Patches
platform: remove the unused interrupt headers. On Zephyr,platform/drivers/interrupt.his only included throughrtos/interrupt-legacy.h, which only the AMD platforms without native drivers use. The host build uses thelibrarycopy. Removes the i.MX8, i.MX8M, i.MX8ULP and posix copies.platform: remove the unused DAI headers.platform/lib/dai.his only included throughsof/lib/dai-legacy.h, which is only used withoutCONFIG_ZEPHYR_NATIVE_DRIVERS. Every i.MX and qemu_xtensa board uses the native drivers, and SOF has no legacy DAI drivers for them. Removes their copies.platform: remove the unused DMA headers. The Zephyrsof/lib/dma.honly includesplatform/lib/dma.hfor the legacy DMA domain schedulers. Only Rembrandt, and MediaTek without native drivers, select those. Removes the i.MX, posix and qemu_xtensa copies.How the files were found
The static include analysis used for the earlier parts ignores
#if. This time the list came from the headers that builds actually depend on, taken fromninja -t depsand the compiler dependency files of:Of the 32 platform headers that none of these builds uses, this PR removes the 17 on platforms whose builds all configure and compile. The other 15 are AMD and MediaTek headers. Those builds fail at configure or compile on main, so the dependency data says nothing about them, and they stay until those platforms build again or move to native drivers.
Functional change
None.
Testing
Run on e9c2a45 (current main), at every commit and at the tip.
Firmware, every commit, incremental builds of 37 configurations:
llext_relocatable.conf, PTL and TGL withdebug_stream_overlay.conf;Each commit builds the same configurations as main (the legacy ones fail with unchanged error sets). Objects, LLEXT modules and images were hashed with the debug sections stripped. The only differences are the objects that embed the source hash or git version, and the LLEXT modules that the incremental builds relink. The pristine tip build shows that the LLEXT modules are identical.
Firmware, tip: a pristine build of the same matrix, compared with a pristine build of main. The SOF header dependencies (
ninja -t deps) and the legacy error sets are unchanged, and all LLEXT modules are identical. The only differing objects are the version-bearing ones:init.c,ext_manifest.c, eachplatform.cand the final images. On imx8m_cm7 and imx95 theisr_tablesobject also differs, becausesof_init()embeds the git hash and changes size on Cortex-M, which moves the ISR addresses in the generated table.Host, every commit: the host library and the cmocka unit test builds (unit_test, imx8, mtk defconfigs) pass. With the debug sections stripped, all 1,291 objects are identical to main at every commit.
native_sim IPC3/IPC4 stub builds: pass.
ZTest: 23 of 23 pass, run as in CI.
check_kernel_includes.py --sources --strict: passes.Documentation: builds with no warnings at every commit.
The testbench and the tools use only the
libraryplatform headers, which this PR does not touch.🤖 Generated with Claude Code