Re: [PATCH 2/2] virtio_ring: fix complaint by sparse

From: Cornelia Huck
Date: Tue Nov 22 2016 - 12:51:49 EST


On Tue, 22 Nov 2016 13:51:50 +0800
Gonglei <arei.gonglei@xxxxxxxxxx> wrote:

> # make C=2 CF="-D__CHECK_ENDIAN__" ./drivers/virtio/
>
> drivers/virtio/virtio_ring.c:423:19: warning: incorrect type in assignment (different base types)
> drivers/virtio/virtio_ring.c:423:19: expected unsigned int [unsigned] [assigned] i
> drivers/virtio/virtio_ring.c:423:19: got restricted __virtio16 [usertype] next
> drivers/virtio/virtio_ring.c:423:19: warning: incorrect type in assignment (different base types)
> drivers/virtio/virtio_ring.c:423:19: expected unsigned int [unsigned] [assigned] i
> drivers/virtio/virtio_ring.c:423:19: got restricted __virtio16 [usertype] next
> drivers/virtio/virtio_ring.c:423:19: warning: incorrect type in assignment (different base types)
> drivers/virtio/virtio_ring.c:423:19: expected unsigned int [unsigned] [assigned] i
> drivers/virtio/virtio_ring.c:423:19: got restricted __virtio16 [usertype] next
> drivers/virtio/virtio_ring.c:604:39: warning: incorrect type in initializer (different base types)
> drivers/virtio/virtio_ring.c:604:39: expected unsigned short [unsigned] [usertype] nextflag
> drivers/virtio/virtio_ring.c:604:39: got restricted __virtio16
> drivers/virtio/virtio_ring.c:612:33: warning: restricted __virtio16 degrades to integer
>
> Signed-off-by: Gonglei <arei.gonglei@xxxxxxxxxx>
> ---
> drivers/virtio/virtio_ring.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Cornelia Huck <cornelia.huck@xxxxxxxxxx>