From 2e65386d3d6e52f18c7ada9151416b8cd7c73786 Mon Sep 17 00:00:00 2001 From: Jinhyung Jo Date: Thu, 1 Jun 2017 20:36:36 +0900 Subject: [PATCH] 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: I7912c36bfd7520de2b9bfb14c92442fdea68d062 Signed-off-by: Jinhyung Jo (cherry picked from commit adbf8ffec5766d9f9c4abe92df6c4c201eb95b80) --- hw/virtio/virtio-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index b6ab3610cb..d44a73a51d 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -140,7 +140,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_set(errp, QERR_INVALID_PARAMETER_VALUE, "period", "a positive number"); return; -- 2.34.1