From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965084AbbBBO2r (ORCPT ); Mon, 2 Feb 2015 09:28:47 -0500 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 Message-ID: <54CF8993.7060901@redhat.com> Date: Mon, 02 Feb 2015 15:28:35 +0100 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= CC: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Nadav Amit , Gleb Natapov Subject: Re: [PATCH 2/8] KVM: x86: cleanup kvm_apic_match_*() 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> In-Reply-To: <20150202142633.GA19731@potion.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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