lkml.org 
[lkml]   [2015]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/8] KVM: x86: cleanup kvm_apic_match_*()


On 02/02/2015 15:26, Radim Krčmář wrote:
>>> > > + 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 '!=').

Lower precedence means that the merged version is right (unless my brain
went bonkers, which I cannot exclude). "!=" has higher precedence and
thus it is implicitly parenthesized.

In fact the first comparison could have its parentheses removed as well.

Paolo


\
 
 \ /
  Last update: 2015-02-02 15:41    [W:0.354 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site