Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884AbdITQPC (ORCPT ); Wed, 20 Sep 2017 12:15:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50014 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751614AbdITQPA (ORCPT ); Wed, 20 Sep 2017 12:15:00 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 75D18C047B77 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=alex.williamson@redhat.com Date: Wed, 20 Sep 2017 10:14:59 -0600 From: Alex Williamson To: Geert Uytterhoeven Cc: Bjorn Helgaas , Arnd Bergmann , Joerg Roedel , linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build Message-ID: <20170920101459.3a6735ad@w520.home> In-Reply-To: <1505132955-9517-1-git-send-email-geert@linux-m68k.org> References: <1505132955-9517-1-git-send-email-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 20 Sep 2017 16:15:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1556 Lines: 41 On Mon, 11 Sep 2017 14:29:15 +0200 Geert Uytterhoeven wrote: > 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 > --- > 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 */ Reviewed-by: Alex Williamson