Re: [PATCH 1/2 v4] KVM: nSVM: Check reserved values for 'Type' and invalid vectors in EVENTINJ

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

 



On 11/12/20 22:44, Krish Sadhukhan wrote:

+    if (valid && (type == SVM_EVTINJ_TYPE_EXEPT))
+        if (vector == NMI_VECTOR || vector > 31)
Preferred style is to combine these into a single statement.


The reason why I split them was to avoid using too many parentheses which was what Paolo was objecting to. 😁

But you kept the parentheses that I was objecting to.  Good:

	if (valid && type == SVM_EVTINJ_TYPE_EXEPT &&
	    (vector == NMI_VECTOR || vector > 31))

Bad:

	if (valid && (type == SVM_EVTINJ_TYPE_EXEPT) &&
	    (vector == NMI_VECTOR || vector > 31))

There should be no parentheses around relational operators, only around & | ^ and && ||.

Thanks,

Paolo




[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