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: Tizen_Studio_1.3_Release_p2.3.2~40^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f5243e4601e98ab9166f832f3e4465edced7d5c;p=sdk%2Femulator%2Fqemu.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] Change-Id: Ieb15882967a2d77aa743955fe7d6c43345ed07bb 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 (cherry picked from commit 1e8e33bc72235089a6602e95a711ae2ea76a76dc) --- diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index 473c04410e..06e71782b2 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; }