diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2016-09-21 16:52:23 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-09-23 19:03:56 +0300 |
commit | b1c7c07f2db2096451791882e9d1cdc301b66cdb (patch) | |
tree | bbfc6e4fd057f5be8959457d843ce7db9336d775 /util/qemu-error.c | |
parent | d65abf85e7e5fce31905eaea322ef2ea26e5f2db (diff) | |
download | qemu-b1c7c07f2db2096451791882e9d1cdc301b66cdb.zip qemu-b1c7c07f2db2096451791882e9d1cdc301b66cdb.tar.gz qemu-b1c7c07f2db2096451791882e9d1cdc301b66cdb.tar.bz2 |
virtio: use unsigned int for virtqueue_get_avail_bytes() index
The virtio code uses int, unsigned int, and uint16_t for virtqueue
indices. The uint16_t is used for the low-level descriptor layout in
virtio_ring.h while code that isn't concerned with descriptor layout can
use unsigned int.
Use of int is problematic because it can result in signed/unsigned
comparison and incompatible int*/unsigned int* pointer types.
Make the virtqueue_get_avail_bytes() 'i' variable unsigned int. This
eliminates the need to introduce casts and modify code further in the
patches that follow.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'util/qemu-error.c')
0 files changed, 0 insertions, 0 deletions