From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756140AbcCUOE3 (ORCPT ); Mon, 21 Mar 2016 10:04:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48264 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755295AbcCUOE2 (ORCPT ); Mon, 21 Mar 2016 10:04:28 -0400 Subject: Re: [PATCH] kvm: Fix build error caused by redefinition To: Pranith Kumar , Gleb Natapov , "open list:KERNEL VIRTUAL MACHINE (KVM)" , open list References: <1458363272-5296-1-git-send-email-bobby.prani@gmail.com> From: Paolo Bonzini Message-ID: <56EFFF68.9020103@redhat.com> Date: Mon, 21 Mar 2016 15:04:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1458363272-5296-1-git-send-email-bobby.prani@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 21 Mar 2016 14:04:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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