diff options
author | Yuri Benditovich <yuri.benditovich@daynix.com> | 2021-03-15 13:59:37 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-04-01 11:39:12 -0400 |
commit | 51e0e42cabe86b1d99055d23f7b732d8f9662208 (patch) | |
tree | 7f9a9f0750c842457af3445b02bc0dbb930b7007 /hw | |
parent | c3fd706165e9875a10606453ee2785dd51e987a5 (diff) | |
download | qemu-51e0e42cabe86b1d99055d23f7b732d8f9662208.zip qemu-51e0e42cabe86b1d99055d23f7b732d8f9662208.tar.gz qemu-51e0e42cabe86b1d99055d23f7b732d8f9662208.tar.bz2 |
virtio-pci: remove explicit initialization of val
The value is assigned later in this procedure.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Message-Id: <20210315115937.14286-3-yuri.benditovich@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/virtio/virtio-pci.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 4a3dcee..c1b67cf 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1385,10 +1385,10 @@ static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr, { VirtIOPCIProxy *proxy = opaque; VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); - uint64_t val = 0; + uint64_t val; if (vdev == NULL) { - return val; + return 0; } switch (size) { @@ -1401,6 +1401,9 @@ static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr, case 4: val = virtio_config_modern_readl(vdev, addr); break; + default: + val = 0; + break; } return val; } |