Messages in this thread | | | Date | Mon, 2 Feb 2015 15:26:34 +0100 | From | Radim Krčmář <> | Subject | Re: [PATCH 2/8] KVM: x86: cleanup kvm_apic_match_*() |
| |
2015-01-30 09:52+0100, Paolo Bonzini: > On 29/01/2015 22:48, Radim Krčmář wrote: > > The majority of this patch turns > > result = 0; if (CODE) result = 1; return result; > > into > > return CODE; > > because we return bool now. > > Added a bunch of "!= 0" to avoid automagic conversion to bool.
(I haven't checked it earlier ... sorry.)
> > - if (((logical_id >> 4) == (mda >> 0x4)) > > - && (logical_id & mda & 0xf)) > > - result = 1; > > - break; > > + return ((logical_id >> 4) == (mda >> 4)) > > + && (logical_id & mda & 0xf);
was merged as
+ return ((logical_id >> 4) == (mda >> 4)) + && (logical_id & mda & 0xf) != 0;
but it has to be parenthesized ('&&' has lower precedence than '!=').
| |