From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Axtens Subject: Re: [PATCH 2/2] KVM: PPC: sparse: prototypes for functions called from assembler Date: Mon, 10 Oct 2016 13:52:41 +1100 Message-ID: <87a8ecykxy.fsf@possimpible.ozlabs.ibm.com> References: <1476059480-18145-1-git-send-email-dja@axtens.net> <1476059480-18145-2-git-send-email-dja@axtens.net> <20161010023415.GA18173@fergus.ozlabs.ibm.com> Mime-Version: 1.0 Content-Type: text/plain Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org To: Paul Mackerras Return-path: Received: from mail-pa0-f68.google.com ([209.85.220.68]:34820 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751597AbcJJCwp (ORCPT ); Sun, 9 Oct 2016 22:52:45 -0400 Received: by mail-pa0-f68.google.com with SMTP id qn10so6199409pac.2 for ; Sun, 09 Oct 2016 19:52:45 -0700 (PDT) In-Reply-To: <20161010023415.GA18173@fergus.ozlabs.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Paul Mackerras writes: > On Mon, Oct 10, 2016 at 11:31:20AM +1100, Daniel Axtens wrote: >> A bunch of KVM functions are only called from assembler. >> Give them prototypes in asm-prototypes.h >> This reduces sparse warnings. >> >> Signed-off-by: Daniel Axtens >> --- >> arch/powerpc/include/asm/asm-prototypes.h | 44 +++++++++++++++++++++++++++++++ >> arch/powerpc/kvm/book3s_64_vio_hv.c | 1 + >> arch/powerpc/kvm/book3s_hv_builtin.c | 1 + >> arch/powerpc/kvm/book3s_hv_ras.c | 1 + >> arch/powerpc/kvm/book3s_hv_rm_mmu.c | 1 + >> arch/powerpc/kvm/book3s_hv_rm_xics.c | 1 + >> 6 files changed, 49 insertions(+) >> >> diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h >> index d1492736d852..6c853bcd11fa 100644 >> --- a/arch/powerpc/include/asm/asm-prototypes.h >> +++ b/arch/powerpc/include/asm/asm-prototypes.h >> @@ -14,6 +14,9 @@ >> >> #include >> #include >> +#ifdef CONFIG_KVM >> +#include >> +#endif >> >> #include >> >> @@ -109,4 +112,45 @@ void early_setup_secondary(void); >> /* time */ >> void accumulate_stolen_time(void); >> >> +/* kvm */ >> +#ifdef CONFIG_KVM > > Why do we need this ifdef? Does the compilation break without it when > CONFIG_KVM = n? Yes it does - the 0day build bot picked it up when I did v1 without the ifdef. See: https://lists.01.org/pipermail/kbuild-all/2016-September/024742.html For example: arch/powerpc/include/asm/asm-prototypes.h:82:7: error: 'struct kvm_vcpu' declared inside parameter list [-Werror] unsigned long tce_list, unsigned long npages); ^ arch/powerpc/include/asm/asm-prototypes.h:85:7: error: 'struct kvm_vcpu' declared inside parameter list [-Werror] unsigned long tce_value, unsigned long npages); ^ arch/powerpc/include/asm/asm-prototypes.h:87:29: error: 'struct kvm_vcpu' declared inside parameter list [-Werror] unsigned int yield_count); ^ arch/powerpc/include/asm/asm-prototypes.h:88:29: error: 'struct kvm_vcpu' declared inside parameter list [-Werror] long kvmppc_h_random(struct kvm_vcpu *vcpu); Regards, Daniel