From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyyVP-0000Dr-3K for qemu-devel@nongnu.org; Thu, 11 Dec 2014 02:49:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyyVK-0008MO-5q for qemu-devel@nongnu.org; Thu, 11 Dec 2014 02:49:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyyVJ-0008MF-VP for qemu-devel@nongnu.org; Thu, 11 Dec 2014 02:49:42 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBB7neTR020517 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 11 Dec 2014 02:49:41 -0500 From: Amit Shah Date: Thu, 11 Dec 2014 13:19:27 +0530 Message-Id: <236dc0c1f599c40fd608de173e08402e0d43a1b6.1418284167.git.amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 1/1] virtio-rng: fix check for period_ms validity List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Amit Shah , Amos Kong 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 Signed-off-by: Amit Shah --- 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 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; } -- 2.1.0