From patchwork Tue Oct 18 01:05:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 683482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sycXN6srwz9sCZ for ; Tue, 18 Oct 2016 12:13:40 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3sycXN5dJkzDvV5 for ; Tue, 18 Oct 2016 12:13:40 +1100 (AEDT) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org X-Greylist: delayed 428 seconds by postgrey-1.36 at bilbo; Tue, 18 Oct 2016 12:13:37 AEDT Received: from ozlabs.ru (ozlabs.ru [83.169.36.222]) by lists.ozlabs.org (Postfix) with ESMTP id 3sycXK1lWRzDvRg for ; Tue, 18 Oct 2016 12:13:36 +1100 (AEDT) Received: from vpl2.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 1F48F1200F3; Tue, 18 Oct 2016 03:05:52 +0200 (CEST) From: Alexey Kardashevskiy To: slof@lists.ozlabs.org Date: Tue, 18 Oct 2016 12:05:49 +1100 Message-Id: <1476752749-41210-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 2.5.0.rc3 In-Reply-To: <89e25659-f277-f84e-bb00-977824426b11@redhat.com> References: <89e25659-f277-f84e-bb00-977824426b11@redhat.com> Subject: [SLOF] [PATCH slof] virtio-serial: Fix compile error X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" This stops using C99 declaration which breaks compile on gcc 4.8. Signed-off-by: Alexey Kardashevskiy Tested-by: Thomas Huth --- 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: */