Re: [PATCH] KVM: X86: correct meaningless kvm_apicv_activated() check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sean Christopherson <sean.j.christopherson@xxxxxxxxx> writes:

> On Mon, Mar 16, 2020 at 09:33:50AM +0100, Vitaly Kuznetsov wrote:
>> Paolo Bonzini <pbonzini@xxxxxxxxxx> 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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux