Patchwork [14/24] s390-ccw.img: Fix compile warning in s390 ccw virtio code

login
register
mail settings
Submitter Alexander Graf
Date April 26, 2013, 6:19 p.m.
Message ID <1367000373-7972-15-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/239903/
State New
Headers show

Comments

Alexander Graf - April 26, 2013, 6:19 p.m.
From: Christian Borntraeger <borntraeger@de.ibm.com>

Lets fix this gcc warning:

virtio.c: In function ‘vring_send_buf’:
virtio.c:125:35: error: operation on ‘vr->next_idx’ may be undefined
[-Werror=sequence-point]

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 pc-bios/s390-ccw/virtio.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Patch

diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index 79e2941..1968fc6 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -122,7 +122,9 @@  static void vring_send_buf(struct vring *vr, void *p, int len, int flags)
     vr->desc[vr->next_idx].addr = (ulong)p;
     vr->desc[vr->next_idx].len = len;
     vr->desc[vr->next_idx].flags = flags & ~VRING_HIDDEN_IS_CHAIN;
-    vr->desc[vr->next_idx].next = ++vr->next_idx;
+    vr->desc[vr->next_idx].next = vr->next_idx;
+    vr->desc[vr->next_idx].next++;
+    vr->next_idx++;
 
     /* Chains only have a single ID */
     if (!(flags & VRING_DESC_F_NEXT)) {