From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH 2/8] KVM: x86: cleanup kvm_apic_match_*() Date: Mon, 2 Feb 2015 15:30:54 +0100 Message-ID: <20150202143054.GC19731@potion.redhat.com> References: <1422568135-28402-1-git-send-email-rkrcmar@redhat.com> <1422568135-28402-3-git-send-email-rkrcmar@redhat.com> <54CB4668.30909@redhat.com> <20150202142633.GA19731@potion.redhat.com> <54CF8993.7060901@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Nadav Amit , Gleb Natapov To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <54CF8993.7060901@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2015-02-02 15:28+0100, Paolo Bonzini: >=20 >=20 > On 02/02/2015 15:26, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > >>> > > + return ((logical_id >> 4) =3D=3D (mda >> 4)) > >>> > > + && (logical_id & mda & 0xf); > > was merged as > >=20 > > + return ((logical_id >> 4) =3D=3D (mda >> 4)) > > + && (logical_id & mda & 0xf) !=3D 0; > >=20 > > but it has to be parenthesized ('&&' has lower precedence than '!=3D= '). >=20 > Lower precedence means that the merged version is right (unless my br= ain > went bonkers, which I cannot exclude). "!=3D" has higher precedence = and > thus it is implicitly parenthesized. >=20 > In fact the first comparison could have its parentheses removed as we= ll. Yes, it could be, logical_id >> 4 =3D=3D mda >> 4 && (logical_id & mda & 0xf) !=3D 0 I missed the point and thought that you wanted to turn the whole expression into bool, when it already was one.