* [PATCH v2] KVM:VMX:Remove scratch 'cpu' variable that shadows an identical scratch var
@ 2022-02-22 10:39 Peng Hao
2022-02-22 15:16 ` Sean Christopherson
2022-02-24 14:24 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Peng Hao @ 2022-02-22 10:39 UTC (permalink / raw)
To: pbonzini, seanjc; +Cc: kvm, linux-kernel
From: Peng Hao <flyingpeng@tencent.com>
Remove a redundant 'cpu' declaration from inside an if-statement that
that shadows an identical declaration at function scope. Both variables
are used as scratch variables in for_each_*_cpu() loops, thus there's no
harm in sharing a variable.
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Peng Hao <flyingpeng@tencent.com>
---
arch/x86/kvm/vmx/vmx.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index ba66c171d951..6101c2980a9c 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -7931,7 +7931,6 @@ static int __init vmx_init(void)
ms_hyperv.hints & HV_X64_ENLIGHTENED_VMCS_RECOMMENDED &&
(ms_hyperv.nested_features & HV_X64_ENLIGHTENED_VMCS_VERSION) >=
KVM_EVMCS_VERSION) {
- int cpu;
/* Check that we have assist pages on all online CPUs */
for_each_online_cpu(cpu) {
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] KVM:VMX:Remove scratch 'cpu' variable that shadows an identical scratch var
2022-02-22 10:39 [PATCH v2] KVM:VMX:Remove scratch 'cpu' variable that shadows an identical scratch var Peng Hao
@ 2022-02-22 15:16 ` Sean Christopherson
2022-02-24 14:24 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Sean Christopherson @ 2022-02-22 15:16 UTC (permalink / raw)
To: Peng Hao; +Cc: pbonzini, kvm, linux-kernel
Needs a space between "KVM:" and "VMX:". No need to resend, Paolo can fixup when
applying.
On Tue, Feb 22, 2022, Peng Hao wrote:
> From: Peng Hao <flyingpeng@tencent.com>
>
> Remove a redundant 'cpu' declaration from inside an if-statement that
> that shadows an identical declaration at function scope. Both variables
> are used as scratch variables in for_each_*_cpu() loops, thus there's no
> harm in sharing a variable.
>
> Reviewed-by: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Peng Hao <flyingpeng@tencent.com>
> ---
> arch/x86/kvm/vmx/vmx.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index ba66c171d951..6101c2980a9c 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -7931,7 +7931,6 @@ static int __init vmx_init(void)
> ms_hyperv.hints & HV_X64_ENLIGHTENED_VMCS_RECOMMENDED &&
> (ms_hyperv.nested_features & HV_X64_ENLIGHTENED_VMCS_VERSION) >=
> KVM_EVMCS_VERSION) {
> - int cpu;
>
> /* Check that we have assist pages on all online CPUs */
> for_each_online_cpu(cpu) {
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] KVM:VMX:Remove scratch 'cpu' variable that shadows an identical scratch var
2022-02-22 10:39 [PATCH v2] KVM:VMX:Remove scratch 'cpu' variable that shadows an identical scratch var Peng Hao
2022-02-22 15:16 ` Sean Christopherson
@ 2022-02-24 14:24 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2022-02-24 14:24 UTC (permalink / raw)
To: Peng Hao, seanjc; +Cc: kvm, linux-kernel
On 2/22/22 11:39, Peng Hao wrote:
> From: Peng Hao <flyingpeng@tencent.com>
>
> Remove a redundant 'cpu' declaration from inside an if-statement that
> that shadows an identical declaration at function scope. Both variables
> are used as scratch variables in for_each_*_cpu() loops, thus there's no
> harm in sharing a variable.
>
> Reviewed-by: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Peng Hao <flyingpeng@tencent.com>
> ---
> arch/x86/kvm/vmx/vmx.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index ba66c171d951..6101c2980a9c 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -7931,7 +7931,6 @@ static int __init vmx_init(void)
> ms_hyperv.hints & HV_X64_ENLIGHTENED_VMCS_RECOMMENDED &&
> (ms_hyperv.nested_features & HV_X64_ENLIGHTENED_VMCS_VERSION) >=
> KVM_EVMCS_VERSION) {
> - int cpu;
>
> /* Check that we have assist pages on all online CPUs */
> for_each_online_cpu(cpu) {
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-24 14:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-22 10:39 [PATCH v2] KVM:VMX:Remove scratch 'cpu' variable that shadows an identical scratch var Peng Hao
2022-02-22 15:16 ` Sean Christopherson
2022-02-24 14:24 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox