qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL 03/18] vring: factor common code for error exits


From: Peter Maydell
Subject: Re: [Qemu-devel] [PULL 03/18] vring: factor common code for error exits
Date: Mon, 13 Jan 2014 10:18:35 +0000

On 20 December 2013 15:46, Stefan Hajnoczi <address@hidden> wrote:
> From: Paolo Bonzini <address@hidden>
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
>  hw/block/dataplane/virtio-blk.c |  1 +
>  hw/virtio/dataplane/vring.c     | 34 +++++++++++++++++++++-------------
>  2 files changed, 22 insertions(+), 13 deletions(-)

This results in a compile warning on gcc 4.6.3, I'm afraid:

/home/petmay01/linaro/qemu-from-laptop/qemu/hw/virtio/dataplane/vring.c:
In function ‘vring_pop’:
/home/petmay01/linaro/qemu-from-laptop/qemu/hw/virtio/dataplane/vring.c:400:29:
error: ‘ret’ may be used uninitialised in this function
[-Werror=uninitialized]

As you suggested on irc, this fixes it:

diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
index 250d45e..665a1ff 100644
--- a/hw/virtio/dataplane/vring.c
+++ b/hw/virtio/dataplane/vring.c
@@ -376,7 +376,7 @@ int vring_pop(VirtIODevice *vdev, Vring *vring,
         barrier();

         if (desc.flags & VRING_DESC_F_INDIRECT) {
-            int ret = get_indirect(vring, elem, &desc);
+            ret = get_indirect(vring, elem, &desc);
             if (ret < 0) {
                 goto out;
             }

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]