From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH] vhost-net: fix reversed logic in mask notifiers Date: Tue, 25 May 2010 18:19:13 +0300 Message-ID: <20100525151913.GA26706@redhat.com> References: <20100525140043.GA19688@redhat.com> <20100525144239.GA26284@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, amit.shah@redhat.com, kraxel@redhat.com To: Juan Quintela Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45332 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757090Ab0EYPX3 (ORCPT ); Tue, 25 May 2010 11:23:29 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4PFNSVr021595 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 25 May 2010 11:23:28 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, May 25, 2010 at 04:58:15PM +0200, Juan Quintela wrote: > "Michael S. Tsirkin" 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. -- MST