[SLOF] [PATCH slof] virtio-serial: Fix compile error

Alexey Kardashevskiy aik at ozlabs.ru
Tue Oct 18 12:05:49 AEDT 2016


This stops using C99 declaration which breaks compile on gcc 4.8.

Signed-off-by: Alexey Kardashevskiy <aik at ozlabs.ru>
---

Thomas,

please give it a try.

Also, where did you get that gcc from? Everything I have around has
switched to 5.x already.

---
 lib/libvirtio/virtio-serial.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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: */
-- 
2.5.0.rc3



More information about the SLOF mailing list