[SLOF] [PATCH slof] virtio-serial: Fix compile error
Thomas Huth
thuth at redhat.com
Tue Oct 18 17:19:38 AEDT 2016
On 18.10.2016 03:05, Alexey Kardashevskiy wrote:
> 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: */
>
Tested-by: Thomas Huth <thuth at redhat.com>
More information about the SLOF
mailing list