On Tue, Sep 24, 2024 at 3:07 PM <marcandre.lur...@redhat.com> wrote: > > From: Marc-André Lureau <marcandre.lur...@redhat.com> > > ../hw/virtio/vhost-shadow-virtqueue.c:545:13: error: ‘r’ may be used > uninitialized [-Werror=maybe-uninitialized] > > Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> > --- > hw/virtio/vhost-shadow-virtqueue.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/virtio/vhost-shadow-virtqueue.c > b/hw/virtio/vhost-shadow-virtqueue.c > index fc5f408f77..cd29cc795b 100644 > --- a/hw/virtio/vhost-shadow-virtqueue.c > +++ b/hw/virtio/vhost-shadow-virtqueue.c > @@ -526,7 +526,7 @@ static void vhost_svq_flush(VhostShadowVirtqueue *svq, > size_t vhost_svq_poll(VhostShadowVirtqueue *svq, size_t num) > { > size_t len = 0; > - uint32_t r; > + uint32_t r = 0; >
I understand this is a bulk changeset to avoid the warning, but does this mean we cannot use pointer arguments to just return information anymore? vhost_svq_get_buf just write to it, it never reads it. If you post a second version and it is convenient for you, it would be useful to move it inside of the while. Any way we solve it, Acked-by: Eugenio Pérez <epere...@redhat.com> > while (num--) { > int64_t start_us = g_get_monotonic_time(); > -- > 2.45.2.827.g557ae147e6 >