mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qian Cai <quic_qiancai@quicinc.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, <kvm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kvm: Avoid shadowing a local in search_memslots()
Date: Tue, 26 Oct 2021 12:14:48 -0400	[thread overview]
Message-ID: <60d32a0d-9c91-8cc5-99bd-7c7a9449f7c1@quicinc.com> (raw)
In-Reply-To: <YXgib3l+sSwy8Sje@google.com>



On 10/26/21 11:44 AM, Sean Christopherson wrote:
> Maybe "pivot"?  Or just "tmp"?  I also vote to hoist the declaration out of the
> loop precisely to avoid potential shadows, and to also associate the variable
> with the "start" and "end" variables, e.g.

Actually, I am a bit more prefer to keep the declaration inside the loop
as it makes the declaration and assignment closer to make it easier to
understand the code. It should be relatively trivial to avoid potential
shadows in the future. It would be interesting to see what Paolo would say.

  parent reply	other threads:[~2021-10-26 16:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 15:13 Qian Cai
2021-10-26 15:44 ` Sean Christopherson
2021-10-26 15:57   ` Qian Cai
2021-10-26 16:14   ` Qian Cai [this message]
2021-10-26 16:18     ` Paolo Bonzini
2021-10-26 16:39       ` Sean Christopherson

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=60d32a0d-9c91-8cc5-99bd-7c7a9449f7c1@quicinc.com \
    --to=quic_qiancai@quicinc.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.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

all inboxes | Powered by JetHome®