Patchwork [1/3] virtio: use unsigned int for counting bytes in vq

login
register
mail settings
Submitter Amit Shah
Date July 6, 2012, 10:37 a.m.
Message ID <fed53883b0d62a999d0cd48f6094f528be5ba89d.1341569262.git.amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/169409/
State New
Headers show

Comments

Amit Shah - July 6, 2012, 10:37 a.m.
The virtqueue_avail_bytes() function counts bytes in an int.  Use an
unsigned int instead.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 hw/virtio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/virtio.c b/hw/virtio.c
index 168abe4..b21dcac 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -338,7 +338,7 @@  static unsigned virtqueue_next_desc(target_phys_addr_t desc_pa,
 int virtqueue_avail_bytes(VirtQueue *vq, int in_bytes, int out_bytes)
 {
     unsigned int idx;
-    int total_bufs, in_total, out_total;
+    unsigned int total_bufs, in_total, out_total;
 
     idx = vq->last_avail_idx;