From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Quintela Subject: Re: [PATCH] vhost-net: fix reversed logic in mask notifiers Date: Tue, 25 May 2010 16:58:15 +0200 Message-ID: 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: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43484 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758953Ab0EYO6R (ORCPT ); Tue, 25 May 2010 10:58:17 -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 o4PEwHZH016976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 25 May 2010 10:58:17 -0400 In-Reply-To: <20100525144239.GA26284@redhat.com> (Michael S. Tsirkin's message of "Tue, 25 May 2010 17:42:39 +0300") Sender: kvm-owner@vger.kernel.org List-ID: "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.