virtio-rng: fix check for period_ms validity
authorAmit Shah <amit.shah@redhat.com>
Thu, 11 Dec 2014 07:47:42 +0000 (13:17 +0530)
committerAmit Shah <amit.shah@redhat.com>
Mon, 5 Jan 2015 08:32:47 +0000 (14:02 +0530)
This was reported for this warning:

hw/virtio/virtio-rng.c:150:31: warning: logical not is only applied to
the left hand side of comparison [-Wlogical-not-parentheses]

Reported-by: dcb
Suggested-by: dcb
Bug: https://bugs.launchpad.net/qemu/+bug/1393486
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
hw/virtio/virtio-rng.c

index 473c04410e9ebfcc67e1eddebf51c76e955fabd5..06e71782b2d1813468a643dab87562eecb20cf5f 100644 (file)
@@ -149,7 +149,7 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp)
     VirtIORNG *vrng = VIRTIO_RNG(dev);
     Error *local_err = NULL;
 
-    if (!vrng->conf.period_ms > 0) {
+    if (vrng->conf.period_ms <= 0) {
         error_setg(errp, "'period' parameter expects a positive integer");
         return;
     }