All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Michael Walle <michael@walle.cc>,
	qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH 1/2] fix GCC 5.0.0 logical-not-parentheses warnings
Date: Wed, 4 Mar 2015 17:27:50 +0100	[thread overview]
Message-ID: <20150304162750.GB25889@potion.redhat.com> (raw)
In-Reply-To: <54F7185F.6070404@msgid.tls.msk.ru>

2015-03-04 17:36+0300, Michael Tokarev:
> 20.02.2015 19:06, Radim Krčmář wrote:
> > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> > -    if (!!n->vhost_started ==
> > -        (virtio_net_started(n, status) && !nc->peer->link_down)) {
> > +    if ((virtio_net_started(n, status) && !nc->peer->link_down) ==
> > +        !!n->vhost_started) {
> 
> btw, can this be rewritten as
>   (bool)n->vhost_started
> instead of
>   !!n->vhos_started

Yes.  (It's the same as long as we use bool from stdbool.h.)

> Not questioning the patch itself, just wondering, as these
> double-negatives look ugly...

Casting to bool looks better to me as well, yet the QEMU design guide,
`grep $x | wc -l`, greatly prefers bangs.

I think that it is best to define it as bool in struct VirtIONet,
but I prefer not to change decision that I don't understand ...

Thanks for accepting the patches.

  reply	other threads:[~2015-03-04 16:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 16:06 [Qemu-devel] [PATCH 0/2] Fix GCC 5.0.0 build errors Radim Krčmář
2015-02-20 16:06 ` [Qemu-devel] [PATCH 1/2] fix GCC 5.0.0 logical-not-parentheses warnings Radim Krčmář
2015-03-04 14:36   ` Michael Tokarev
2015-03-04 16:27     ` Radim Krčmář [this message]
2015-02-20 16:06 ` [Qemu-devel] [PATCH 2/2] milkymist-pfpu: fix GCC 5.0.0 aggressive-loop-optimizations warning Radim Krčmář
2015-02-23 17:32   ` [Qemu-trivial] " Michael Walle
2015-02-23 17:32     ` [Qemu-devel] " Michael Walle
2015-02-20 17:04 ` [Qemu-trivial] [PATCH 0/2] Fix GCC 5.0.0 build errors Radim Krčmář
2015-02-20 17:04   ` [Qemu-devel] " Radim Krčmář
2015-03-04 14:38 ` [Qemu-trivial] " Michael Tokarev
2015-03-04 14:38   ` [Qemu-devel] " Michael Tokarev
  -- strict thread matches above, loose matches on Subject: below --
2015-02-20 14:18 Radim Krčmář
2015-02-20 14:18 ` [Qemu-devel] [PATCH 1/2] fix GCC 5.0.0 logical-not-parentheses warnings Radim Krčmář
2015-02-20 14:38   ` Paolo Bonzini
2015-02-20 15:43     ` Radim Krčmář

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=20150304162750.GB25889@potion.redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=michael@walle.cc \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.