From: Sean Christopherson <seanjc@google.com>
To: Peng Hao <flyingpenghao@gmail.com>
Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] x86/kvm: remove a redundant variable
Date: Fri, 18 Feb 2022 16:10:23 +0000 [thread overview]
Message-ID: <Yg/E71MbiFWq9A0p@google.com> (raw)
In-Reply-To: <20220218110747.11455-1-flyingpeng@tencent.com>
Similar comments to the other patch. "KVM: VMX:" for the scope, and a more descriptive
shortlog.
Also, this patch isn't part of a series, it should be simply "PATCH", not "patch 1/4".
On Fri, Feb 18, 2022, Peng Hao wrote:
> variable 'cpu' is defined repeatedly.
The changelog should make it clear why it's ok to remove the redundant variable.
E.g.
KVM: VMX: Remove scratch 'cpu' variable that shadows an identical scratch var
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.
With that,
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
>
prev parent reply other threads:[~2022-02-18 16:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-18 11:07 [PATCH 1/4] x86/kvm: remove a redundant variable Peng Hao
2022-02-18 16:10 ` Sean Christopherson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yg/E71MbiFWq9A0p@google.com \
--to=seanjc@google.com \
--cc=flyingpenghao@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox