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