From patchwork Thu Dec 11 07:49:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 419973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CC72C140081 for ; Thu, 11 Dec 2014 18:50:13 +1100 (AEDT) Received: from localhost ([::1]:49661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyyVl-0000Y7-9a for incoming@patchwork.ozlabs.org; Thu, 11 Dec 2014 02:50:09 -0500 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 Received: from localhost (ovpn-113-34.phx2.redhat.com [10.3.113.34]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBB7ndcw016042; Thu, 11 Dec 2014 02:49:40 -0500 From: Amit Shah To: qemu list Date: Thu, 11 Dec 2014 13:19:27 +0530 Message-Id: <236dc0c1f599c40fd608de173e08402e0d43a1b6.1418284167.git.amit.shah@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Amit Shah , Amos Kong Subject: [Qemu-devel] [PATCH 1/1] virtio-rng: fix check for period_ms validity X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Gonglei Reviewed-by: Amos Kong --- 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; }