From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 2/8] KVM: x86: cleanup kvm_apic_match_*() Date: Mon, 02 Feb 2015 15:28:35 +0100 Message-ID: <54CF8993.7060901@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> 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: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50201 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933163AbbBBO2p (ORCPT ); Mon, 2 Feb 2015 09:28:45 -0500 In-Reply-To: <20150202142633.GA19731@potion.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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'= ). Lower precedence means that the merged version is right (unless my brai= n went bonkers, which I cannot exclude). "!=3D" has higher precedence an= d thus it is implicitly parenthesized. In fact the first comparison could have its parentheses removed as well= =2E Paolo