[PATCH 2/2] KVM: PPC: sparse: prototypes for functions called from assembler

Paul Mackerras paulus at ozlabs.org
Mon Oct 10 13:34:15 AEDT 2016


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 <dja at axtens.net>
> ---
>  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 <linux/threads.h>
>  #include <linux/kprobes.h>
> +#ifdef CONFIG_KVM
> +#include <linux/kvm_host.h>
> +#endif
>  
>  #include <uapi/asm/ucontext.h>
>  
> @@ -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?

Paul.


More information about the Linuxppc-dev mailing list