Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751577AbdGZThS (ORCPT ); Wed, 26 Jul 2017 15:37:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45076 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751544AbdGZThQ (ORCPT ); Wed, 26 Jul 2017 15:37:16 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 82A0C6408E Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=alex.williamson@redhat.com Date: Wed, 26 Jul 2017 13:37:15 -0600 From: Alex Williamson To: Murilo Opsfelder Araujo Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Michael Ellerman , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH Message-ID: <20170726133715.7cb039cb@w520.home> In-Reply-To: <20170718172220.9954-1-mopsfelder@gmail.com> References: <20170718172220.9954-1-mopsfelder@gmail.com> 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.38]); Wed, 26 Jul 2017 19:37:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2161 Lines: 63 On Tue, 18 Jul 2017 14:22:20 -0300 Murilo Opsfelder Araujo wrote: > When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the > following: > > drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release': > vfio_pci.c:(.text+0xa98): undefined reference to `.vfio_spapr_pci_eeh_release' > drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_open': > vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open' > > In this case, vfio_pci.c should use the empty definitions of > vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions. > > This patch fixes it by guarding these function definitions with > CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is > built, which is where the non-empty versions of these functions are. We need to > make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate > option. > > This issue was found during a randconfig build. Logs are here: > > http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/ > > Signed-off-by: Murilo Opsfelder Araujo > --- Applied to my for-linus branch with David and Alexey's R-b for v4.13. Thanks, Alex > > Changes from v1: > - Rebased on top of next-20170718. > > include/linux/vfio.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/vfio.h b/include/linux/vfio.h > index 586809a..a47b985 100644 > --- a/include/linux/vfio.h > +++ b/include/linux/vfio.h > @@ -152,7 +152,7 @@ extern int vfio_set_irqs_validate_and_prepare(struct vfio_irq_set *hdr, > size_t *data_size); > > struct pci_dev; > -#ifdef CONFIG_EEH > +#if IS_ENABLED(CONFIG_VFIO_SPAPR_EEH) > extern void vfio_spapr_pci_eeh_open(struct pci_dev *pdev); > extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev); > extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, > @@ -173,7 +173,7 @@ static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, > { > return -ENOTTY; > } > -#endif /* CONFIG_EEH */ > +#endif /* CONFIG_VFIO_SPAPR_EEH */ > > /* > * IRQfd - generic > -- > 2.9.4