From: Michael Kelley Sent: Saturday, July 6, 2024 7:12 PM [ ... ] > > > > If we then stub out swiotlb_find_pool to return NULL for !CONFIG_SWIOTLB, > > we also don't need extra stubs for all the __swiotlb_ helpers as the > > compiler will eliminate the calls as dead code. > > Yes, this works as long as the declarations for the __swiotlb_foo > functions are *not* under CONFIG_SWIOTLB. But when compiling with > !CONFIG_SWIOTLB on arm64 with gcc-8.5.0, two tangentially related > compile errors occur. iommu_dma_map_page() references > swiotlb_tlb_map_single(). The declaration for the latter is under > CONFIG_SWIOTLB. A similar problem occurs with dma_direct_map_page() > and swiotlb_map(). Do later versions of gcc not complain when the > reference is in dead code? Or are these just bugs that occurred because > !CONFIG_SWIOTLB is rare? If the latter, I can submit a separate patch to > move the declarations out from under CONFIG_SWIOTLB. >
Ignore the "two tangentially related compile errors". I schlepped some code around incorrectly and caused the problem myself. :-( Michael