From patchwork Thu Jun 8 00:06:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Murilo_Opsfelder_Ara=C3=BAjo?= X-Patchwork-Id: 772741 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wjm412mG8z9sDB for ; Thu, 8 Jun 2017 10:08:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y1kcraXT"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wjm411cCSzDqL3 for ; Thu, 8 Jun 2017 10:08:49 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y1kcraXT"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wjm2N6qybzDqCt for ; Thu, 8 Jun 2017 10:07:24 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y1kcraXT"; dkim-atps=neutral Received: by mail-qt0-x244.google.com with SMTP id w1so4793006qtg.0 for ; Wed, 07 Jun 2017 17:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yAOoaUp8yTUq8JF8cQBhqBKaeaRm25vc2z510qT0uns=; b=Y1kcraXT4bsUpsMLPxDVoX5+5b1w6/zS3wynl+N9oTKEw2GU/vZcvVDdRml1+bjom/ 7qgQeGzhpgLmfSSwzRh/R+0IP0NTUiRiWzvGp9s9M5rgRuQ6zxoNQkGfz/ypQTq+SxKL AtzKf960TLaFMbCcxsBv1GkfkMPVZI7e2gfB6prqyeIdDHrQ4fKn/FJYfjhjQcs5jDJS 6/sQuRbDO+PoA8271UXsCre8ubdUrfg4t2xKXv6V5Cw9YNP/WzvuNOc8nwaeEl3nGLwq Ad9DwhWZOuVFjJ4dp4i6stH3udtxHuUaRFDDWpCgYJSKoRiIW6ywCy5TM1PLO6nIz84s /UOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yAOoaUp8yTUq8JF8cQBhqBKaeaRm25vc2z510qT0uns=; b=JW++Q0b4US688/Eef+cjgH0dQolN2aFHDcmVlSCmkU0tI5rTlKWvyHghnaseX0Vi11 eqEcyIFjBjbYk1AEmxjEyk5eXQeEArmlo2eDHZ+r7/1IsbvGLqj98xvmmUd9nda8gxD7 CyOubKTgX6qZqpbsTmHcwU88oDwZsc7RpLcmnVzHZwrzyW4O5RjAT8eHR+A4iaiK+2xY Lkf1BK8Vluq4I8Zl5ZKGYvV1eIWq99DgqaXBeE34zjoIbvhWkXN/A5IsSSV5Qfx3oHuU 7VVIFzS8BGzv/2aTVLjQogkH4R1m3jhf3XXnlKHSfnH9AtOE9GbRz9erEIFVC8l0v5fk NJwg== X-Gm-Message-State: AODbwcAMRNQanLWcWMOOEZuyreqhlhVh5YgJbrgfsKRmGLMaCbyAvDFf RPiUnobYp7/Wqg== X-Received: by 10.55.15.159 with SMTP id 31mr39166441qkp.197.1496880442367; Wed, 07 Jun 2017 17:07:22 -0700 (PDT) Received: from kermit-br-ibm-com.ibmmodules.com ([2804:431:f725:77e:860f:4c12:3655:4481]) by smtp.gmail.com with ESMTPSA id f72sm2049077qka.56.2017.06.07.17.07.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2017 17:07:21 -0700 (PDT) From: Murilo Opsfelder Araujo To: linux-kernel@vger.kernel.org Subject: [PATCH v2] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH Date: Wed, 7 Jun 2017 21:06:14 -0300 Message-Id: <20170608000614.6481-1-mopsfelder@gmail.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170606120914.15851-1-mopsfelder@gmail.com> References: <20170606120914.15851-1-mopsfelder@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kbuild test robot , kvm@vger.kernel.org, Murilo Opsfelder Araujo , Alex Williamson , kbuild-all@01.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 --- v1..v2: - Make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate option (fix http://www.spinics.net/lists/kvm/msg151032.html). 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 edf9b2c..92232f73 100644 --- a/include/linux/vfio.h +++ b/include/linux/vfio.h @@ -150,7 +150,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, @@ -171,7 +171,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