From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
linmiaohe@huawei.com, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: X86: correct meaningless kvm_apicv_activated() check
Date: Mon, 16 Mar 2020 16:44:47 +0100 [thread overview]
Message-ID: <87zhcgl2xc.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20200316152650.GD24267@linux.intel.com>
Sean Christopherson <sean.j.christopherson@intel.com> writes:
> On Mon, Mar 16, 2020 at 09:33:50AM +0100, Vitaly Kuznetsov wrote:
>> Paolo Bonzini <pbonzini@redhat.com> writes:
>> > + if ((old == 0) == (new == 0))
>> > + return;
>>
>> This is a very laconic expression I personally find hard to read :-)
>>
>> /* Check if WE actually changed APICv state */
>> if ((!old && !new) || (old && new))
>> return;
>>
>> would be my preference (not strong though, I read yours several times
>> and now I feel like I understand it just fine :-)
>
> Or maybe this to avoid so many equals signs?
>
> if (!old == !new)
> return;
>
if (!!old == !!new)
return;
to make it clear we're converting them to 1/0 :-)
--
Vitaly
next prev parent reply other threads:[~2020-03-16 15:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-14 11:31 [PATCH] KVM: X86: correct meaningless kvm_apicv_activated() check Paolo Bonzini
2020-03-16 8:33 ` Vitaly Kuznetsov
2020-03-16 15:26 ` Sean Christopherson
2020-03-16 15:44 ` Vitaly Kuznetsov [this message]
2020-03-16 15:59 ` Sean Christopherson
2020-03-16 16:39 ` Paolo Bonzini
2020-03-17 11:24 ` Xiaoyao Li
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=87zhcgl2xc.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=sean.j.christopherson@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.