qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 7/7] libvhost-user: Switch to unsigned int for inuse field in


From: Marcel Holtmann
Subject: Re: [PATCH 7/7] libvhost-user: Switch to unsigned int for inuse field in struct VuVirtq
Date: Tue, 20 Dec 2022 20:04:24 +0100

Hi Michael,

>> It seems there is no need to keep the inuse field signed and end up with
>> compiler warnings for sign-compare.
>> 
>>  CC       libvhost-user.o
>> libvhost-user.c: In function ‘vu_queue_pop’:
>> libvhost-user.c:2763:19: error: comparison of integer expressions of 
>> different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare]
>> 2763 |     if (vq->inuse >= vq->vring.num) {
>>      |                   ^~
>> libvhost-user.c: In function ‘vu_queue_rewind’:
>> libvhost-user.c:2808:13: error: comparison of integer expressions of 
>> different signedness: ‘unsigned int’ and ‘int’ [-Werror=sign-compare]
>> 2808 |     if (num > vq->inuse) {
>>      |             ^
>> 
>> Instead of casting the comparision to unsigned int, just make the inuse
>> field unsigned int in the fist place.
>> 
>> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> 
> 
> Is this a part of a patchset? No threading visible and I'd rather not
> guess.

I am going to re-send both series as v2.

Regards

Marcel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]