Skip to contentSkip to conversation

hw/virtio/virtio-rng.c:150: bad test ?

Qemu-devel dcb 2 participants 3 messages Nov 17, 2014 – Jun 23, 2016

lore
Share & tools
lore

dcb

author
#0 lore raw

Public bug reported:

hw/virtio/virtio-rng.c:150:31: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]

    if (!vrng->conf.period_ms > 0) {
        error_setg(errp, "'period' parameter expects a positive integer");
        return;
    }

Maybe better code

    if (vrng->conf.period_ms <= 0) {
        error_setg(errp, "'period' parameter expects a positive integer");
        return;
    }

** Affects: qemu
Importance: Undecided
Status: New

Signature · 28 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1393486

Title:
  hw/virtio/virtio-rng.c:150: bad test ?

Status in QEMU:
  New

Bug description:
  hw/virtio/virtio-rng.c:150:31: warning: logical not is only applied to
  the left hand side of comparison [-Wlogical-not-parentheses]

      if (!vrng->conf.period_ms > 0) {
          error_setg(errp, "'period' parameter expects a positive integer");
          return;
      }

  Maybe better code

      if (vrng->conf.period_ms <= 0) {
          error_setg(errp, "'period' parameter expects a positive integer");
          return;
      }

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1393486/+subscriptions
#1 lore raw
Quoted 10 lines · dcb

Public bug reported:

hw/virtio/virtio-rng.c:150:31: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]

    if (!vrng->conf.period_ms > 0) {
        error_setg(errp, "'period' parameter expects a positive integer");
        return;
    }
Quoted 6 lines

Maybe better code

    if (vrng->conf.period_ms <= 0) {
        error_setg(errp, "'period' parameter expects a positive integer");
        return;
    }

Thanks!

Do you want to submit a patch, since you've identified the fix as well?

Amit

author
#2 lore raw
In reply to dcb

Fixed here:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=a3a292c420d2fec3c07

** Changed in: qemu
Status: New => Fix Released

Signature · 28 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1393486

Title:
  hw/virtio/virtio-rng.c:150: bad test ?

Status in QEMU:
  Fix Released

Bug description:
  hw/virtio/virtio-rng.c:150:31: warning: logical not is only applied to
  the left hand side of comparison [-Wlogical-not-parentheses]

      if (!vrng->conf.period_ms > 0) {
          error_setg(errp, "'period' parameter expects a positive integer");
          return;
      }

  Maybe better code

      if (vrng->conf.period_ms <= 0) {
          error_setg(errp, "'period' parameter expects a positive integer");
          return;
      }

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1393486/+subscriptions