mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-16 14:41:55 -06:00
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>
This commit is contained in:
parent
c3fd706165
commit
51e0e42cab
1 changed files with 5 additions and 2 deletions
|
@ -1385,10 +1385,10 @@ static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr,
|
||||||
{
|
{
|
||||||
VirtIOPCIProxy *proxy = opaque;
|
VirtIOPCIProxy *proxy = opaque;
|
||||||
VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
|
VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
|
||||||
uint64_t val = 0;
|
uint64_t val;
|
||||||
|
|
||||||
if (vdev == NULL) {
|
if (vdev == NULL) {
|
||||||
return val;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (size) {
|
switch (size) {
|
||||||
|
@ -1401,6 +1401,9 @@ static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr,
|
||||||
case 4:
|
case 4:
|
||||||
val = virtio_config_modern_readl(vdev, addr);
|
val = virtio_config_modern_readl(vdev, addr);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
val = 0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue