Re: [PATCHv2] qemu-kvm/vhost: fix up irqfd support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux