From: "Michael S. Tsirkin" <mst@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: kvm@vger.kernel.org, amit.shah@redhat.com, kraxel@redhat.com
Subject: Re: [PATCH] vhost-net: fix reversed logic in mask notifiers
Date: Tue, 25 May 2010 18:19:13 +0300 [thread overview]
Message-ID: <20100525151913.GA26706@redhat.com> (raw)
In-Reply-To: <m3hblwhvug.fsf@trasno.mitica>
On Tue, May 25, 2010 at 04:58:15PM +0200, Juan Quintela wrote:
> "Michael S. Tsirkin" <mst@redhat.com> 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
next prev parent reply other threads:[~2010-05-25 15:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 14:00 [PATCH] vhost-net: fix reversed logic in mask notifiers Michael S. Tsirkin
2010-05-25 14:25 ` Amit Shah
2010-05-25 14:37 ` Juan Quintela
2010-05-25 14:42 ` Michael S. Tsirkin
2010-05-25 14:58 ` Juan Quintela
2010-05-25 15:19 ` Michael S. Tsirkin [this message]
2010-05-25 15:30 ` Juan Quintela
2010-05-25 14:48 ` Gerd Hoffmann
2010-05-27 13:54 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100525151913.GA26706@redhat.com \
--to=mst@redhat.com \
--cc=amit.shah@redhat.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).