aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/virtio-rng.c
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2014-12-11 13:17:42 +0530
committerAmit Shah <amit.shah@redhat.com>2015-01-05 14:02:47 +0530
commita3a292c420d2fec3c07a7ca56fbb064cd57a298a (patch)
treeab437da7616e45edd8918430594262cce794575e /hw/virtio/virtio-rng.c
parentab0302ee764fd702465aef6d88612cdff4302809 (diff)
downloadqemu-a3a292c420d2fec3c07a7ca56fbb064cd57a298a.zip
qemu-a3a292c420d2fec3c07a7ca56fbb064cd57a298a.tar.gz
qemu-a3a292c420d2fec3c07a7ca56fbb064cd57a298a.tar.bz2
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] 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>
Diffstat (limited to 'hw/virtio/virtio-rng.c')
-rw-r--r--hw/virtio/virtio-rng.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index 473c044..06e7178 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;
}