linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build
@ 2017-09-11 12:29 Geert Uytterhoeven
  2017-09-20 12:12 ` Joerg Roedel
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2017-09-11 12:29 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Arnd Bergmann, Alex Williamson, Joerg Roedel, linux-pci, iommu,
	linux-kernel, Geert Uytterhoeven

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() isn't actually ever 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.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 include/linux/pci.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index f68c58a93dd045b9..f4f8ee5a7362e982 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1685,6 +1685,8 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
 
 #define dev_is_pci(d) (false)
 #define dev_is_pf(d) (false)
+static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags)
+{ return false; }
 #endif /* CONFIG_PCI */
 
 /* Include architecture-dependent settings and functions */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-09-25 16:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-11 12:29 [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build Geert Uytterhoeven
2017-09-20 12:12 ` Joerg Roedel
2017-09-20 16:14 ` Alex Williamson
2017-09-22 15:56 ` Bjorn Helgaas
2017-09-22 17:51   ` Joerg Roedel
2017-09-22 18:12   ` Geert Uytterhoeven
2017-09-25 16:13     ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).