From: Amit Shah Date: Thu, 11 Dec 2014 07:47:42 +0000 (+0530) Subject: virtio-rng: fix check for period_ms validity X-Git-Tag: qemu-xen-4.6.0-rc3^0 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b05befcbea71a979509ce04f02929969a790c923;p=qemu-upstream-4.6-testing.git virtio-rng: fix check for period_ms validity 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] upstream-commit-id: a3a292c420d2fec3c07a7ca56fbb064cd57a298a Reported-by: dcb Suggested-by: dcb Bug: https://bugs.launchpad.net/qemu/+bug/1393486 Reviewed-by: Gonglei Reviewed-by: Amos Kong Signed-off-by: Amit Shah Signed-off-by: Stefano Stabellini --- diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index 473c04410..06e71782b 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -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; }