* [PATCH 2/2] virtio_ring: fix complaint by sparse
@ 2016-11-22 5:51 ` Gonglei
0 siblings, 0 replies; 18+ messages in thread
From: Gonglei @ 2016-11-22 5:51 UTC (permalink / raw)
To: virtualization, linux-kernel; +Cc: Gonglei, mst
# 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@huawei.com>
---
drivers/virtio/virtio_ring.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 489bfc6..d2863c3 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -420,7 +420,7 @@ static inline int virtqueue_add(struct virtqueue *_vq,
if (i == err_idx)
break;
vring_unmap_one(vq, &desc[i]);
- i = vq->vring.desc[i].next;
+ i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next);
}
vq->vq.num_free += total_sg;
@@ -601,7 +601,7 @@ bool virtqueue_kick(struct virtqueue *vq)
static void detach_buf(struct vring_virtqueue *vq, unsigned int head)
{
unsigned int i, j;
- u16 nextflag = cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT);
+ __virtio16 nextflag = cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT);
/* Clear data ptr. */
vq->desc_state[head].data = NULL;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] virtio_ring: fix complaint by sparse
2016-11-22 5:51 ` Gonglei
(?)
@ 2016-11-22 15:04 ` Michael S. Tsirkin
2016-11-22 15:16 ` Thomas Huth
-1 siblings, 1 reply; 18+ messages in thread
From: Michael S. Tsirkin @ 2016-11-22 15:04 UTC (permalink / raw)
To: Gonglei; +Cc: virtualization, linux-kernel, jasowang, david, thuth
On Tue, Nov 22, 2016 at 01:51:50PM +0800, Gonglei 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@huawei.com>
> ---
> drivers/virtio/virtio_ring.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index 489bfc6..d2863c3 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -420,7 +420,7 @@ static inline int virtqueue_add(struct virtqueue *_vq,
> if (i == err_idx)
> break;
> vring_unmap_one(vq, &desc[i]);
> - i = vq->vring.desc[i].next;
> + i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next);
> }
>
> vq->vq.num_free += total_sg;
> @@ -601,7 +601,7 @@ bool virtqueue_kick(struct virtqueue *vq)
> static void detach_buf(struct vring_virtqueue *vq, unsigned int head)
> {
> unsigned int i, j;
> - u16 nextflag = cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT);
> + __virtio16 nextflag = cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT);
>
> /* Clear data ptr. */
> vq->desc_state[head].data = NULL;
> --
> 1.8.3.1
>
Wow are you saying endian-ness is all wrong for the next field?
How do things ever work then?
--
MST
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] virtio_ring: fix complaint by sparse
2016-11-22 15:04 ` Michael S. Tsirkin
@ 2016-11-22 15:16 ` Thomas Huth
0 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2016-11-22 15:16 UTC (permalink / raw)
To: Michael S. Tsirkin, Gonglei
Cc: david, linux-kernel, virtualization, Andy Lutomirski
On 22.11.2016 16:04, Michael S. Tsirkin wrote:
> On Tue, Nov 22, 2016 at 01:51:50PM +0800, Gonglei 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@huawei.com>
>> ---
>> drivers/virtio/virtio_ring.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
>> index 489bfc6..d2863c3 100644
>> --- a/drivers/virtio/virtio_ring.c
>> +++ b/drivers/virtio/virtio_ring.c
>> @@ -420,7 +420,7 @@ static inline int virtqueue_add(struct virtqueue *_vq,
>> if (i == err_idx)
>> break;
>> vring_unmap_one(vq, &desc[i]);
>> - i = vq->vring.desc[i].next;
>> + i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next);
>> }
>>
>> vq->vq.num_free += total_sg;
[...]
> Wow are you saying endian-ness is all wrong for the next field?
> How do things ever work then?
The above code is only in the error cleanup path (after the
"unmap_release" label, introduced by commit 780bc7903), so it likely has
never been exercised in the field.
I think Gonlei's patch is right, there should be a virtio16_to_cpu() here.
Thomas
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] virtio_ring: fix complaint by sparse
@ 2016-11-22 15:16 ` Thomas Huth
0 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2016-11-22 15:16 UTC (permalink / raw)
To: Michael S. Tsirkin, Gonglei
Cc: virtualization, linux-kernel, Andy Lutomirski, david
On 22.11.2016 16:04, Michael S. Tsirkin wrote:
> On Tue, Nov 22, 2016 at 01:51:50PM +0800, Gonglei 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@huawei.com>
>> ---
>> drivers/virtio/virtio_ring.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
>> index 489bfc6..d2863c3 100644
>> --- a/drivers/virtio/virtio_ring.c
>> +++ b/drivers/virtio/virtio_ring.c
>> @@ -420,7 +420,7 @@ static inline int virtqueue_add(struct virtqueue *_vq,
>> if (i == err_idx)
>> break;
>> vring_unmap_one(vq, &desc[i]);
>> - i = vq->vring.desc[i].next;
>> + i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next);
>> }
>>
>> vq->vq.num_free += total_sg;
[...]
> Wow are you saying endian-ness is all wrong for the next field?
> How do things ever work then?
The above code is only in the error cleanup path (after the
"unmap_release" label, introduced by commit 780bc7903), so it likely has
never been exercised in the field.
I think Gonlei's patch is right, there should be a virtio16_to_cpu() here.
Thomas
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] virtio_ring: fix complaint by sparse
2016-11-22 15:16 ` Thomas Huth
@ 2016-11-22 17:25 ` Andy Lutomirski
-1 siblings, 0 replies; 18+ messages in thread
From: Andy Lutomirski @ 2016-11-22 17:25 UTC (permalink / raw)
To: Thomas Huth
Cc: Michael S. Tsirkin, Gonglei, david, linux-kernel,
Linux Virtualization, Andy Lutomirski
On Tue, Nov 22, 2016 at 7:16 AM, Thomas Huth <thuth@redhat.com> wrote:
> On 22.11.2016 16:04, Michael S. Tsirkin wrote:
>> On Tue, Nov 22, 2016 at 01:51:50PM +0800, Gonglei 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@huawei.com>
>>> ---
>>> drivers/virtio/virtio_ring.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
>>> index 489bfc6..d2863c3 100644
>>> --- a/drivers/virtio/virtio_ring.c
>>> +++ b/drivers/virtio/virtio_ring.c
>>> @@ -420,7 +420,7 @@ static inline int virtqueue_add(struct virtqueue *_vq,
>>> if (i == err_idx)
>>> break;
>>> vring_unmap_one(vq, &desc[i]);
>>> - i = vq->vring.desc[i].next;
>>> + i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next);
>>> }
>>>
>>> vq->vq.num_free += total_sg;
> [...]
>> Wow are you saying endian-ness is all wrong for the next field?
>> How do things ever work then?
>
> The above code is only in the error cleanup path (after the
> "unmap_release" label, introduced by commit 780bc7903), so it likely has
> never been exercised in the field.
> I think Gonlei's patch is right, there should be a virtio16_to_cpu() here.
Agreed.
>
> Thomas
>
>
--
Andy Lutomirski
AMA Capital Management, LLC
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] virtio_ring: fix complaint by sparse
@ 2016-11-22 17:25 ` Andy Lutomirski
0 siblings, 0 replies; 18+ messages in thread
From: Andy Lutomirski @ 2016-11-22 17:25 UTC (permalink / raw)
To: Thomas Huth
Cc: Michael S. Tsirkin, linux-kernel, Linux Virtualization, Gonglei,
Andy Lutomirski, david
On Tue, Nov 22, 2016 at 7:16 AM, Thomas Huth <thuth@redhat.com> wrote:
> On 22.11.2016 16:04, Michael S. Tsirkin wrote:
>> On Tue, Nov 22, 2016 at 01:51:50PM +0800, Gonglei 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@huawei.com>
>>> ---
>>> drivers/virtio/virtio_ring.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
>>> index 489bfc6..d2863c3 100644
>>> --- a/drivers/virtio/virtio_ring.c
>>> +++ b/drivers/virtio/virtio_ring.c
>>> @@ -420,7 +420,7 @@ static inline int virtqueue_add(struct virtqueue *_vq,
>>> if (i == err_idx)
>>> break;
>>> vring_unmap_one(vq, &desc[i]);
>>> - i = vq->vring.desc[i].next;
>>> + i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next);
>>> }
>>>
>>> vq->vq.num_free += total_sg;
> [...]
>> Wow are you saying endian-ness is all wrong for the next field?
>> How do things ever work then?
>
> The above code is only in the error cleanup path (after the
> "unmap_release" label, introduced by commit 780bc7903), so it likely has
> never been exercised in the field.
> I think Gonlei's patch is right, there should be a virtio16_to_cpu() here.
Agreed.
>
> Thomas
>
>
--
Andy Lutomirski
AMA Capital Management, LLC
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] virtio_ring: fix complaint by sparse
2016-11-22 5:51 ` Gonglei
(?)
(?)
@ 2016-11-22 15:04 ` Michael S. Tsirkin
-1 siblings, 0 replies; 18+ messages in thread
From: Michael S. Tsirkin @ 2016-11-22 15:04 UTC (permalink / raw)
To: Gonglei; +Cc: thuth, david, linux-kernel, virtualization
On Tue, Nov 22, 2016 at 01:51:50PM +0800, Gonglei 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@huawei.com>
> ---
> drivers/virtio/virtio_ring.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index 489bfc6..d2863c3 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -420,7 +420,7 @@ static inline int virtqueue_add(struct virtqueue *_vq,
> if (i == err_idx)
> break;
> vring_unmap_one(vq, &desc[i]);
> - i = vq->vring.desc[i].next;
> + i = virtio16_to_cpu(_vq->vdev, vq->vring.desc[i].next);
> }
>
> vq->vq.num_free += total_sg;
> @@ -601,7 +601,7 @@ bool virtqueue_kick(struct virtqueue *vq)
> static void detach_buf(struct vring_virtqueue *vq, unsigned int head)
> {
> unsigned int i, j;
> - u16 nextflag = cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT);
> + __virtio16 nextflag = cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT);
>
> /* Clear data ptr. */
> vq->desc_state[head].data = NULL;
> --
> 1.8.3.1
>
Wow are you saying endian-ness is all wrong for the next field?
How do things ever work then?
--
MST
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] virtio_ring: fix complaint by sparse
2016-11-22 5:51 ` Gonglei
@ 2016-11-22 17:50 ` Cornelia Huck
-1 siblings, 0 replies; 18+ messages in thread
From: Cornelia Huck @ 2016-11-22 17:50 UTC (permalink / raw)
To: Gonglei; +Cc: virtualization, linux-kernel, mst
On Tue, 22 Nov 2016 13:51:50 +0800
Gonglei <arei.gonglei@huawei.com> 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@huawei.com>
> ---
> drivers/virtio/virtio_ring.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/2] virtio_ring: fix complaint by sparse
@ 2016-11-22 17:50 ` Cornelia Huck
0 siblings, 0 replies; 18+ messages in thread
From: Cornelia Huck @ 2016-11-22 17:50 UTC (permalink / raw)
To: Gonglei; +Cc: mst, linux-kernel, virtualization
On Tue, 22 Nov 2016 13:51:50 +0800
Gonglei <arei.gonglei@huawei.com> 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@huawei.com>
> ---
> drivers/virtio/virtio_ring.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
^ permalink raw reply [flat|nested] 18+ messages in thread