Re: [PATCH] vhost-net: fix reversed logic in mask notifiers

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

 



"Michael S. Tsirkin" <mst@xxxxxxxxxx> wrote:
> On Tue, May 25, 2010 at 04:58:15PM +0200, Juan Quintela wrote:
>> "Michael S. Tsirkin" <mst@xxxxxxxxxx> wrote:
>> > On Tue, May 25, 2010 at 04:37:36PM +0200, Juan Quintela wrote:
>> 
>> >> we have:
>> >> 
>> >> if (msix_is_masked())
>> >>    return 0
>> >> r = msix_mask_notifier(....., !msix_is_masked());
>> >> 
>> >> i.e. at that point msix_is_masked() is false, or we really, really needs
>> >> locking.
>> >> 
>> >> Puttting a !foo, when we know that it needs to be an 1 looks strange.
>> >> 
>> >> Later, Juan.
>> >> 
>> >> PD.  Yes, I already asked in a previous version to just have two
>> >> methods, mask/unmask.  we now at call time which one we need.
>> >
>> >
>> > I find msix_is_masked clearer here than true since you don't need
>> > to look up definition to understand what this 'true' stands for.
>> > The value is clear from code above. What do you think?
>> 
>> I preffer the change, but it is up to you.
>> 
>> at that point, we are using !msix_masked() to mean "true"
>> 
>> i.e. we know that msix_masked() is false.  What you want to do is "mask".
>> 
>> Later, Juan.
>
> Right. I guess I'll keep it as is, when I look at it with a fresh mind
> next time, I'll clean it all up.

ok with me.
--
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