qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] virtio-rng: fix check for period_ms validity
@ 2014-12-11  7:49 Amit Shah
  2014-12-11  8:14 ` Gonglei
  2014-12-11  9:38 ` Amos Kong
  0 siblings, 2 replies; 3+ messages in thread
From: Amit Shah @ 2014-12-11  7:49 UTC (permalink / raw)
  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 <amit.shah@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] virtio-rng: fix check for period_ms validity
  2014-12-11  7:49 [Qemu-devel] [PATCH 1/1] virtio-rng: fix check for period_ms validity Amit Shah
@ 2014-12-11  8:14 ` Gonglei
  2014-12-11  9:38 ` Amos Kong
  1 sibling, 0 replies; 3+ messages in thread
From: Gonglei @ 2014-12-11  8:14 UTC (permalink / raw)
  To: Amit Shah; +Cc: Amos Kong, qemu list

On 2014/12/11 15:49, Amit Shah wrote:

> 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 <amit.shah@redhat.com>
> ---
>  hw/virtio/virtio-rng.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Gonglei <arei.gonglei@huawei.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] virtio-rng: fix check for period_ms validity
  2014-12-11  7:49 [Qemu-devel] [PATCH 1/1] virtio-rng: fix check for period_ms validity Amit Shah
  2014-12-11  8:14 ` Gonglei
@ 2014-12-11  9:38 ` Amos Kong
  1 sibling, 0 replies; 3+ messages in thread
From: Amos Kong @ 2014-12-11  9:38 UTC (permalink / raw)
  To: Amit Shah; +Cc: qemu list

[-- Attachment #1: Type: text/plain, Size: 1102 bytes --]

On Thu, Dec 11, 2014 at 01:19:27PM +0530, Amit Shah wrote:
> 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 <amit.shah@redhat.com>
> ---
>  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) {

Thanks.

Reviewed-by: Amos Kong <akong@redhat.com>

>          error_setg(errp, "'period' parameter expects a positive integer");
>          return;
>      }
> -- 
> 2.1.0

-- 
			Amos.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-11  9:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11  7:49 [Qemu-devel] [PATCH 1/1] virtio-rng: fix check for period_ms validity Amit Shah
2014-12-11  8:14 ` Gonglei
2014-12-11  9:38 ` Amos Kong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).