[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 09/10] libvduse: Switch to unsigned int for inuse field in
From: |
Yongji Xie |
Subject: |
Re: [PATCH v2 09/10] libvduse: Switch to unsigned int for inuse field in struct VduseVirtq |
Date: |
Wed, 21 Dec 2022 19:32:09 +0800 |
On Wed, Dec 21, 2022 at 3:27 AM Marcel Holtmann <marcel@holtmann.org> wrote:
>
> It seems there is no need to keep the inuse field signed and end up with
> compiler warnings for sign-compare.
>
> CC libvduse.o
> libvduse.c: In function ‘vduse_queue_pop’:
> libvduse.c:789:19: error: comparison of integer expressions of different
> signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare]
> 789 | if (vq->inuse >= vq->vring.num) {
> | ^~
>
> Instead of casting the comparison to unsigned int, just make the inuse
> field unsigned int in the fist place.
>
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> ---
> subprojects/libvduse/libvduse.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Xie Yongji <xieyongji@bytedance.com>
Thanks,
Yongji
- [PATCH v2 04/10] libvhost-user: Use unsigned int i for some for-loop iterations, (continued)
- [PATCH v2 04/10] libvhost-user: Use unsigned int i for some for-loop iterations, Marcel Holtmann, 2022/12/20
- [PATCH v2 01/10] libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU, Marcel Holtmann, 2022/12/20
- [PATCH v2 03/10] libvhost-user: Cast rc variable to avoid compiler warning, Marcel Holtmann, 2022/12/20
- [PATCH v2 05/10] libvhost-user: Declare uffdio_register early to make it C90 compliant, Marcel Holtmann, 2022/12/20
- [PATCH v2 08/10] libvduse: Provide _GNU_SOURCE when compiling outside of QEMU, Marcel Holtmann, 2022/12/20
- [PATCH v2 06/10] libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant, Marcel Holtmann, 2022/12/20
- [PATCH v2 07/10] libvhost-user: Switch to unsigned int for inuse field in struct VuVirtq, Marcel Holtmann, 2022/12/20
- [PATCH v2 09/10] libvduse: Switch to unsigned int for inuse field in struct VduseVirtq, Marcel Holtmann, 2022/12/20
- Re: [PATCH v2 09/10] libvduse: Switch to unsigned int for inuse field in struct VduseVirtq,
Yongji Xie <=
- [RFC v2 10/10] libvduse: Fix assignment in vring_set_avail_event, Marcel Holtmann, 2022/12/20