From patchwork Tue Jul 18 17:22:20 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: 790421 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xBn9J4WNsz9s4s for ; Wed, 19 Jul 2017 03:25:08 +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="pLRfsHVu"; 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 3xBn9J3MptzDrHm for ; Wed, 19 Jul 2017 03:25:08 +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="pLRfsHVu"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) (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 3xBn704swrzDrH2 for ; Wed, 19 Jul 2017 03:23:08 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pLRfsHVu"; dkim-atps=neutral Received: by mail-qt0-x242.google.com with SMTP id 19so3152946qty.1 for ; Tue, 18 Jul 2017 10:23:08 -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:mime-version :content-transfer-encoding; bh=+5VWHZitA8l2ERaWEQOJcLQ4J8xoVye0Wyl5p5aB+z4=; b=pLRfsHVuhyJL4iWbmr8xnF95Ra6TZCUK2UKDZTKY22zoR3Db5ntRKBlr6oMovM4gKz B4VgTTCPcY7xVPJP18Frv/CzdarNADn0ROzbjQ5NzB+n+g60F/26fqeixoLZIOqi3DQB 6VqIV8UKktMJ3ShFV0rDCdZtCtoTD3BxSeGIA8hjGU09d6DFXlPH/D+goL15z6pVMGvI Yny9YHqH6XiDpsFELwTCHN62fYS7+UFzJQ1ozYIX0twY7Y+7sfG0CfmWHPwDQCOSryl+ FJapcQbUz1RRgdWIeYiD6RTzTueuhTZ5JL+FDlkgUJ8TPxDnaBiBSFZMlfZbmWXI2VYU y0MA== 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:mime-version :content-transfer-encoding; bh=+5VWHZitA8l2ERaWEQOJcLQ4J8xoVye0Wyl5p5aB+z4=; b=R/SKMnYzy33L/h1OJ/uymV8oDozmWGFfgPrWFQJQ7vvL0UAGE+jE29HQvGE5I0/x7L H6hoU6D5SU8Ier4Krnxk0LigUjcRruQMC6EDHYfQTYfalNpKla66UvZvuMQMYqkL1hhV SMKGqxFpGKkIy7Lgu5PGTFdOdtPVFBKFp6qxmDYLTGoGi2enJdZtQBtwtcW0gUKyk9mj ueNii7VWzQkpUazBsGILtDFkXfElUUzXFxELjyLuofdNcT7RKYScCKYJVZErBALjYMdb C6qnBcvkn0IMNVuVEFncfe6Mj4rQc4+QptHpcdp0/0c9WED1dXZKjaGNPjZ71krNhMTB 5HcA== X-Gm-Message-State: AIVw111nFCGnXPtRsQxLg70WJX1a/pmUH+KSpsmpORYxvjZHvnbegwfn MAjYNQlSBFohTg== X-Received: by 10.237.56.135 with SMTP id k7mr3634962qte.134.1500398585975; Tue, 18 Jul 2017 10:23:05 -0700 (PDT) Received: from kermit-br-ibm-com.br.ibm.com ([32.104.18.202]) by smtp.gmail.com with ESMTPSA id z192sm1964571qka.46.2017.07.18.10.23.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jul 2017 10:23:05 -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: Tue, 18 Jul 2017 14:22:20 -0300 Message-Id: <20170718172220.9954-1-mopsfelder@gmail.com> X-Mailer: git-send-email 2.9.4 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: Alex Williamson , linuxppc-dev@lists.ozlabs.org, Murilo Opsfelder Araujo , kvm@vger.kernel.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 Reviewed-by: Alexey Kardashevskiy Reviewed-by: Alexey Kardashevskiy Reviewed-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- Changes from v1: - Rebased on top of next-20170718. include/linux/vfio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.4 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