Fix erroneous double negation in conditional
Quoted 6 lines · Raphael Norwitz
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.
It converts the value to bool.
Quoted 23 lines
This
change removes it.Signed-off-by Raphael Norwitz <[email protected]>--- hw/virtio/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/virtio/vhost.c +1
-1@@ -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) {Signature · 1 line
1.8.3.1