linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: kvm@vger.kernel.org, Alex Williamson <alex.williamson@redhat.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, kbuild test robot <lkp@intel.com>,
	kbuild-all@01.org, Murilo Opsfelder Araujo <mopsfelder@gmail.com>
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	[thread overview]
Message-ID: <20170608000614.6481-1-mopsfelder@gmail.com> (raw)
In-Reply-To: <20170606120914.15851-1-mopsfelder@gmail.com>

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 <mopsfelder@gmail.com>
---
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
-- 
2.9.4

  parent reply	other threads:[~2017-06-08  0:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 12:09 [PATCH] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH Murilo Opsfelder Araujo
2017-06-07 10:49 ` Michael Ellerman
2017-06-07 16:31 ` kbuild test robot
2017-06-08  5:35   ` Alexey Kardashevskiy
2017-06-08  5:36     ` Alexey Kardashevskiy
2017-06-13  8:36       ` [kbuild-all] " Ye Xiaolong
2017-06-08 11:41     ` Michael Ellerman
2017-06-08 12:45       ` Murilo Opsfelder Araújo
2017-06-08 13:10         ` Alexey Kardashevskiy
2017-06-08 15:32           ` Murilo Opsfelder Araújo
2017-06-08  0:06 ` Murilo Opsfelder Araujo [this message]
2017-07-18 17:22 [PATCH v2] " Murilo Opsfelder Araujo
2017-07-25 13:56 ` Murilo Opsfelder Araújo
2017-07-25 15:44   ` Alex Williamson
2017-07-26  2:06     ` Alexey Kardashevskiy
2017-07-26  3:25 ` David Gibson
2017-07-26 19:37 ` Alex Williamson
2017-07-27 19:36   ` Murilo Opsfelder Araújo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170608000614.6481-1-mopsfelder@gmail.com \
    --to=mopsfelder@gmail.com \
    --cc=alex.williamson@redhat.com \
    --cc=kbuild-all@01.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lkp@intel.com \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).