[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 07/10] virtio: use unsigned int for virtqueue
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH v3 07/10] virtio: use unsigned int for virtqueue_get_avail_bytes() index |
Date: |
Tue, 20 Sep 2016 13:45:50 +0200 |
On Tue, 12 Apr 2016 14:25:31 +0100
Stefan Hajnoczi <address@hidden> wrote:
> 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 <address@hidden>
> ---
> hw/virtio/virtio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Cornelia Huck <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v3 07/10] virtio: use unsigned int for virtqueue_get_avail_bytes() index,
Cornelia Huck <=