All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Pranith Kumar <bobby.prani@gmail.com>,
	Gleb Natapov <gleb@kernel.org>,
	"open list:KERNEL VIRTUAL MACHINE (KVM)" <kvm@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kvm: Fix build error caused by redefinition
Date: Mon, 21 Mar 2016 15:04:24 +0100	[thread overview]
Message-ID: <56EFFF68.9020103@redhat.com> (raw)
In-Reply-To: <1458363272-5296-1-git-send-email-bobby.prani@gmail.com>



On 19/03/2016 05:54, Pranith Kumar wrote:
> Build on 32-bit PPC fails with the following error:
> 
>  int kvm_vfio_ops_init(void)
>       ^
>  In file included from arch/powerpc/kvm/../../../virt/kvm/vfio.c:21:0:
>  arch/powerpc/kvm/../../../virt/kvm/vfio.h:8:90: note: previous definition of ‘kvm_vfio_ops_init’ was here
>  arch/powerpc/kvm/../../../virt/kvm/vfio.c:292:6: error: redefinition of ‘kvm_vfio_ops_exit’
>  void kvm_vfio_ops_exit(void)
>              ^
>  In file included from arch/powerpc/kvm/../../../virt/kvm/vfio.c:21:0:
>  arch/powerpc/kvm/../../../virt/kvm/vfio.h:12:91: note: previous definition of ‘kvm_vfio_ops_exit’ was here
>  scripts/Makefile.build:258: recipe for target 'arch/powerpc/kvm/../../../virt/kvm/vfio.o' failed
>  make[3]: *** [arch/powerpc/kvm/../../../virt/kvm/vfio.o] Error 1
> 
> Fix it by enclosing the definitions within CONFIG_KVM_VFIO

Please test this instead:

diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
index 7f7b6d86ac73..eba0bea6e032 100644
--- a/arch/powerpc/kvm/Makefile
+++ b/arch/powerpc/kvm/Makefile
@@ -8,7 +8,8 @@ ccflags-y := -Ivirt/kvm -Iarch/powerpc/kvm
 KVM := ../../../virt/kvm

 common-objs-y = $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
-		$(KVM)/eventfd.o $(KVM)/vfio.o
+		$(KVM)/eventfd.o
+common-objs-$(CONFIG_KVM_VFIO) += $(KVM)/vfio.o

 CFLAGS_e500_mmu.o := -I.
 CFLAGS_e500_mmu_host.o := -I.


Paolo

  reply	other threads:[~2016-03-21 14:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-19  4:54 [PATCH] kvm: Fix build error caused by redefinition Pranith Kumar
2016-03-21 14:04 ` Paolo Bonzini [this message]
2016-03-22 13:28   ` Pranith Kumar

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=56EFFF68.9020103@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bobby.prani@gmail.com \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.