From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50695 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3XTi-0004AA-7X for qemu-devel@nongnu.org; Wed, 06 Oct 2010 13:08:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P3XTh-0000xD-27 for qemu-devel@nongnu.org; Wed, 06 Oct 2010 13:08:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P3XTg-0000x7-Qn for qemu-devel@nongnu.org; Wed, 06 Oct 2010 13:08:29 -0400 Date: Wed, 6 Oct 2010 19:02:22 +0200 From: "Michael S. Tsirkin" Message-ID: <20101006170222.GB13486@redhat.com> References: <20101006145650.GA10968@redhat.com> <1286383724.3020.8.camel@x201> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1286383724.3020.8.camel@x201> Subject: [Qemu-devel] Re: [PATCHv2] qemu-kvm/vhost: fix up irqfd support List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: kvm@vger.kernel.org, Juan Quintela , mtosatti@redhat.com, qemu-devel@nongnu.org, avi@redhat.com, Amit Shah On Wed, Oct 06, 2010 at 10:48:44AM -0600, Alex Williamson wrote: > > -int msix_unset_mask_notifier(PCIDevice *dev, unsigned vector) > > +static int msix_unset_mask_notifier_for_vector(PCIDevice *dev, unsigned vector) > > { > > int r = 0; > > - void *opaque; > > if (vector >= dev->msix_entries_nr || !dev->msix_entry_used[vector]) > > return 0; > > > > - opaque = dev->msix_mask_notifier_opaque[vector]; > > - > > assert(dev->msix_mask_notifier); > > - assert(opaque); > > > > /* Mask the old notifier unless it is already masked. */ > > if (!msix_is_masked(dev, vector)) { > > - r = dev->msix_mask_notifier(dev, vector, opaque, true); > > + r = dev->msix_mask_notifier(dev, vector, true); > > if (r < 0) { > > return r; > > } > > } > > - dev->msix_mask_notifier_opaque[vector] = NULL; > > + return r; > > +} > > The above need to be combined to a single function now since the only > difference is s/true/false. > > Alex This is the way it was in the past, and it turned out to be very confusing to read since both variables: mask and assign are bool but polarity is reversed. Unrolled it seems easier to grok. -- MST