From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 3/4] KVM: gracefully handle zero in kvm_free_irq_source_id() Date: Sun, 30 Nov 2008 12:28:05 +0200 Message-ID: <49326AB5.2050807@redhat.com> References: <1227867951.3643.24.camel@blaa> <1227867971-1716-1-git-send-email-markmc@redhat.com> <1227867971-1716-2-git-send-email-markmc@redhat.com> <1227867971-1716-3-git-send-email-markmc@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Sheng Yang To: Mark McLoughlin Return-path: Received: from mx2.redhat.com ([66.187.237.31]:55758 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751104AbYK3K2J (ORCPT ); Sun, 30 Nov 2008 05:28:09 -0500 In-Reply-To: <1227867971-1716-3-git-send-email-markmc@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Mark McLoughlin wrote: > Allow kvm_free_irq_source_id() to be called with a zero ID. > > Zero is reserved for KVM_USERSPACE_IRQ_SOURCE_ID, so we can > guarantee that kvm_request_irq_source_id() will never return > zero and use zero to indicate "no source ID allocated". > > Zero is a legal value for irq source ids, overloading it as something else is confusing. Things should continue to work if we #define it to 17. > + } > + > + ASSERT(irq_source_id != 0); /* KVM_USERSPACE_IRQ_SOURCE_ID reserved */ > Why not replace 0 with the actual symbolic constant? -- error compiling committee.c: too many arguments to function