From 23d780b53f460f8a923dc62ce3cf81554219763e Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Tue, 18 Oct 2016 12:03:58 +1100 Subject: virtio-serial: Fix compile error This stops using C99 declaration which breaks compile on gcc 4.8. Signed-off-by: Alexey Kardashevskiy Tested-by: Thomas Huth --- lib/libvirtio/virtio-serial.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libvirtio') diff --git a/lib/libvirtio/virtio-serial.c b/lib/libvirtio/virtio-serial.c index 6234346..d2eac63 100644 --- a/lib/libvirtio/virtio-serial.c +++ b/lib/libvirtio/virtio-serial.c @@ -38,6 +38,7 @@ int virtio_serial_init(struct virtio_device *dev) { struct vring_avail *vq_avail; int status = VIRTIO_STAT_ACKNOWLEDGE; + int i; /* Reset device */ virtio_reset_device(dev); @@ -68,7 +69,7 @@ int virtio_serial_init(struct virtio_device *dev) } /* Prepare receive buffer queue */ - for (int i = 0; i < RX_NUM_ELEMS; i++) { + for (i = 0; i < RX_NUM_ELEMS; i++) { uint64_t addr = (uint64_t)vq_rx.buf_mem + i * RX_ELEM_SIZE; /* Descriptor for data: */ -- cgit v1.1