Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Add dummy pci_acs_enabled() for CONFIG_PCI=n build

If CONFIG_PCI=n and gcc (e.g. 4.1.2) decides not to inline
get_pci_function_alias_group(), the build fails with:

drivers/iommu/iommu.o: In function `get_pci_function_alias_group':
iommu.c:(.text+0xfdc): undefined reference to `pci_acs_enabled'

Due to the various dummies for PCI calls in the CONFIG_PCI=n case,
pci_acs_enabled() never called, but not all versions of gcc are smart
enough to realize that.

While explicitly marking get_pci_function_alias_group() inline would fix
the build, this would inflate the code for the CONFIG_PCI=y case, as
get_pci_function_alias_group() is a not-so-small function called from two
places.

Hence fix the issue by introducing a dummy for pci_acs_enabled() instead.

Fixes: 0ae349a0f33f ("iommu/qcom: Add qcom_iommu")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>

authored by

Geert Uytterhoeven and committed by
Bjorn Helgaas
fe594932 749aaf33

+2
+2
include/linux/pci.h
··· 1685 1685 1686 1686 #define dev_is_pci(d) (false) 1687 1687 #define dev_is_pf(d) (false) 1688 + static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags) 1689 + { return false; } 1688 1690 #endif /* CONFIG_PCI */ 1689 1691 1690 1692 /* Include architecture-dependent settings and functions */