[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] fix GCC 5.0.0 logical-not-parentheses warni
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] fix GCC 5.0.0 logical-not-parentheses warnings |
Date: |
Wed, 04 Mar 2015 17:36:15 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 |
20.02.2015 19:06, Radim Krčmář wrote:
[]
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 45da34ad6129..93818675588e 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -120,8 +120,8 @@ static void virtio_net_vhost_status(VirtIONet *n, uint8_t
> status)
> return;
> }
>
> - 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
?
Not questioning the patch itself, just wondering, as these
double-negatives look ugly...
Thanks,
/mjt
- Re: [Qemu-devel] [PATCH 1/2] fix GCC 5.0.0 logical-not-parentheses warnings,
Michael Tokarev <=