From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/10] Trivial: Remove KVM_IRQ_BITMAP macro Date: Tue, 17 Jul 2007 16:25:59 +0300 Message-ID: <469CC367.1000107@qumranet.com> References: <1184677946.10380.4.camel@localhost.localdomain> <1184678060.10380.7.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Rusty Russell Return-path: In-Reply-To: <1184678060.10380.7.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Rusty Russell wrote: > Creating one's own BITMAP macro seems suboptimal: if we use manual > arithmetic in the one place exposed to userspace, we can use standard > macros elsewhere. > > The - 7 + 8 calc is overkill: can NR_IRQ_WORDS ever really change? > Looks like it can: > > /* for KVM_CREATE_MEMORY_REGION */ > struct kvm_memory_region { > @@ -163,7 +157,7 @@ struct kvm_sregs { > __u64 cr0, cr2, cr3, cr4, cr8; > __u64 efer; > __u64 apic_base; > - __u64 interrupt_bitmap[KVM_IRQ_BITMAP_SIZE(__u64)]; > + __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 7) / 8]; > }; > > The size is in bytes, but the element type is __u64. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/