Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753888AbbDGMie (ORCPT ); Tue, 7 Apr 2015 08:38:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39949 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753171AbbDGMiN (ORCPT ); Tue, 7 Apr 2015 08:38:13 -0400 Message-ID: <5523CFB0.7040409@redhat.com> Date: Tue, 07 Apr 2015 14:38:08 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org CC: kvm@vger.kernel.org, Nadav Amit , Gleb Natapov Subject: Re: [PATCH v2 4/4] KVM: x86: simplify kvm_apic_map References: <1423766494-26150-1-git-send-email-rkrcmar@redhat.com> <1423766494-26150-5-git-send-email-rkrcmar@redhat.com> In-Reply-To: <1423766494-26150-5-git-send-email-rkrcmar@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 Content-Length: 769 Lines: 29 On 12/02/2015 19:41, Radim Krčmář wrote: > +static inline void > +apic_logical_id(struct kvm_apic_map *map, u32 dest_id, u16 *cid, u16 *lid) > +{ > + BUILD_BUG_ON(KVM_APIC_MODE_XAPIC_CLUSTER != 4); > + BUILD_BUG_ON(KVM_APIC_MODE_XAPIC_FLAT != 8); > + BUILD_BUG_ON(KVM_APIC_MODE_X2APIC != 16); > + I added unsigned lid_bits = map->mode; here (used in the rest of apic_logical_id) and applied the series. Thanks, Paolo > + *cid = dest_id >> map->mode; > + *lid = dest_id & ((1 << map->mode) - 1); > +} -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/