2019-10-19 08:02:37

by Yue Haibing

[permalink] [raw]
Subject: [PATCH -next] x86/hyperv: Fix build error while CONFIG_PARAVIRT=n

while CONFIG_PARAVIRT=n, building fails:

arch/x86/kernel/cpu/mshyperv.c: In function ms_hyperv_init_platform:
arch/x86/kernel/cpu/mshyperv.c:219:2: error: pv_info undeclared (first use in this function); did you mean pr_info?
pv_info.name = "Hyper-V";
^~~~~~~

Wrap it into a #ifdef to fix this.

Fixes: 628270ef628a ("x86/hyperv: Set pv_info.name to "Hyper-V"")
Signed-off-by: YueHaibing <[email protected]>
---
arch/x86/kernel/cpu/mshyperv.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index e7f0776..c656d92 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -216,7 +216,9 @@ static void __init ms_hyperv_init_platform(void)
int hv_host_info_ecx;
int hv_host_info_edx;

+#ifdef CONFIG_PARAVIRT
pv_info.name = "Hyper-V";
+#endif

/*
* Extract the features and hints
--
2.7.4



2019-10-19 08:14:21

by Andrea Parri

[permalink] [raw]
Subject: Re: [PATCH -next] x86/hyperv: Fix build error while CONFIG_PARAVIRT=n

On Fri, Oct 18, 2019 at 04:29:21PM +0800, YueHaibing wrote:
> while CONFIG_PARAVIRT=n, building fails:
>
> arch/x86/kernel/cpu/mshyperv.c: In function ms_hyperv_init_platform:
> arch/x86/kernel/cpu/mshyperv.c:219:2: error: pv_info undeclared (first use in this function); did you mean pr_info?
> pv_info.name = "Hyper-V";
> ^~~~~~~

Ouch, sorry for this...


>
> Wrap it into a #ifdef to fix this.
>
> Fixes: 628270ef628a ("x86/hyperv: Set pv_info.name to "Hyper-V"")
> Signed-off-by: YueHaibing <[email protected]>

Reviewed-by: Andrea Parri <[email protected]>

Thanks,
Andrea


> ---
> arch/x86/kernel/cpu/mshyperv.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> index e7f0776..c656d92 100644
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -216,7 +216,9 @@ static void __init ms_hyperv_init_platform(void)
> int hv_host_info_ecx;
> int hv_host_info_edx;
>
> +#ifdef CONFIG_PARAVIRT
> pv_info.name = "Hyper-V";
> +#endif
>
> /*
> * Extract the features and hints
> --
> 2.7.4
>
>