qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Yuri Benditovich <yuri.benditovich@daynix.com>
Subject: [PULL 5/9] virtio-pci: remove explicit initialization of val
Date: Thu, 1 Apr 2021 14:03:02 -0400	[thread overview]
Message-ID: <20210401180235.226321-6-mst@redhat.com> (raw)
In-Reply-To: <20210401180235.226321-1-mst@redhat.com>

From: Yuri Benditovich <yuri.benditovich@daynix.com>

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>
---
 hw/virtio/virtio-pci.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 4a3dcee771..c1b67cf6fc 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;
 }
-- 
MST



  parent reply	other threads:[~2021-04-01 18:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 18:02 [PULL 0/9] pc,virtio,pci: bugfixes Michael S. Tsirkin
2021-04-01 18:02 ` [PULL 1/9] vhost-user-blk: use different event handlers on initialization Michael S. Tsirkin
2021-04-01 18:02 ` [PULL 2/9] vhost-user-blk: perform immediate cleanup if disconnect " Michael S. Tsirkin
2021-04-01 18:02 ` [PULL 3/9] vhost-user-blk: add immediate cleanup on shutdown Michael S. Tsirkin
2021-04-01 18:03 ` [PULL 4/9] virtio-pci: add check for vdev in virtio_pci_isr_read Michael S. Tsirkin
2021-04-01 18:03 ` Michael S. Tsirkin [this message]
2021-04-01 18:03 ` [PULL 6/9] acpi/piix4: reinitialize acpi PM device on reset Michael S. Tsirkin
2021-04-01 18:03 ` [PULL 7/9] vt82c686.c: don't raise SCI when PCI_INTERRUPT_PIN isn't setup Michael S. Tsirkin
2021-04-01 18:03 ` [PULL 8/9] isa/v582c686: Reinitialize ACPI PM device on reset Michael S. Tsirkin
2021-04-01 18:03 ` [PULL 9/9] pci: sprinkle assert in PCI pin number Michael S. Tsirkin
2021-04-04 20:47 ` [PULL 0/9] pc,virtio,pci: bugfixes Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210401180235.226321-6-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=yuri.benditovich@daynix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).