Commit a3a292c4 authored by Amit Shah's avatar Amit Shah
Browse files

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]

Reported-by: dcb
Suggested-by: dcb
Bug: https://bugs.launchpad.net/qemu/+bug/1393486


Reviewed-by: default avatarGonglei <arei.gonglei@huawei.com>
Reviewed-by: default avatarAmos Kong <akong@redhat.com>
Signed-off-by: default avatarAmit Shah <amit.shah@redhat.com>
parent ab0302ee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
    }