From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752166AbcGAMsH (ORCPT ); Fri, 1 Jul 2016 08:48:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52009 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750702AbcGAMsE (ORCPT ); Fri, 1 Jul 2016 08:48:04 -0400 Date: Fri, 1 Jul 2016 14:48:00 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "Lan, Tianyu" , Igor Mammedov , Jan Kiszka , Peter Xu Subject: Re: [PATCH v1 04/11] KVM: x86: use u16 for logical VCPU mask in lapic Message-ID: <20160701124759.GB27840@potion> References: <20160630205429.16480-1-rkrcmar@redhat.com> <20160630205429.16480-5-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 01 Jul 2016 12:48:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-07-01 09:56+0200, Paolo Bonzini: > On 30/06/2016 22:54, Radim Krčmář wrote: >> @@ -747,7 +745,7 @@ static inline bool kvm_apic_map_get_dest_lapic(struct kvm *kvm, struct kvm_lapic >> return true; >> >> lowest = kvm_vector_to_index(irq->vector, hweight16(*bitmap), >> - bitmap, 16); >> + (unsigned long *)bitmap, 16); >> > > kvm_vector_to_index's last argument is always 16, so we might as well > omit it and make the third argument u16* too. The other callsite in kvm_irq_delivery_to_apic() does not pass 16: int idx = kvm_vector_to_index(irq->vector, dest_vcpus, dest_vcpu_bitmap, KVM_MAX_VCPUS); kvm_vector_to_index() uses find_next_bit(), so we would have two casts if we changed the type. This patch is not really needed, so I could drop it instead.