All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix erroneous double negation in conditional
@ 2020-05-07 20:06 Raphael Norwitz
  2020-05-07 20:28 ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: Raphael Norwitz @ 2020-05-07 20:06 UTC (permalink / raw)
  To: qemu-devel, mst, qemu-trivial

In vhost_migration_log() there is the following check:
    if(!!enable == dev->log_enabled) {
        return 0;
    }

The double negative “!!” is unnecessary and bad coding style. This
change removes it.

Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
---
 hw/virtio/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index aff98a0..83be0c8 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -814,7 +814,7 @@ static int vhost_migration_log(MemoryListener
*listener, int enable)
     struct vhost_dev *dev = container_of(listener, struct vhost_dev,
                                          memory_listener);
     int r;
-    if (!!enable == dev->log_enabled) {
+    if (enable == dev->log_enabled) {
         return 0;
     }
     if (!dev->started) {
--
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-07 20:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1588046669-24706-1-git-send-email-raphael.norwitz@nutanix.com>
2020-05-07 20:34 ` [PATCH] Fix erroneous double negation in conditional Michael S. Tsirkin
2020-05-07 20:06 Raphael Norwitz
2020-05-07 20:28 ` Eric Blake

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.