[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 40/41] libvhost-user: Switch to unsigned int for inuse field in st
From: |
Michael S. Tsirkin |
Subject: |
[PULL 40/41] libvhost-user: Switch to unsigned int for inuse field in struct VuVirtq |
Date: |
Wed, 21 Dec 2022 08:06:33 -0500 |
From: Marcel Holtmann <marcel@holtmann.org>
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>
Message-Id: <20221219175337.377435-8-marcel@holtmann.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
subprojects/libvhost-user/libvhost-user.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/subprojects/libvhost-user/libvhost-user.h
b/subprojects/libvhost-user/libvhost-user.h
index aea7ec5061..8cda9b8f57 100644
--- a/subprojects/libvhost-user/libvhost-user.h
+++ b/subprojects/libvhost-user/libvhost-user.h
@@ -343,7 +343,7 @@ typedef struct VuVirtq {
/* Notification enabled? */
bool notification;
- int inuse;
+ unsigned int inuse;
vu_queue_handler_cb handler;
--
MST
- [PULL 27/41] vhost: fix vq dirty bitmap syncing when vIOMMU is enabled, (continued)
- [PULL 27/41] vhost: fix vq dirty bitmap syncing when vIOMMU is enabled, Michael S. Tsirkin, 2022/12/21
- [PULL 29/41] pci: drop redundant PCIDeviceClass::is_bridge field, Michael S. Tsirkin, 2022/12/21
- [PULL 30/41] docs/acpi/bits: document BITS_DEBUG environment variable, Michael S. Tsirkin, 2022/12/21
- [PULL 34/41] hw/virtio: Add missing "hw/core/cpu.h" include, Michael S. Tsirkin, 2022/12/21
- [PULL 28/41] remove DEC 21154 PCI bridge, Michael S. Tsirkin, 2022/12/21
- [PULL 33/41] hw/cxl/device: Add Flex Bus Port DVSEC, Michael S. Tsirkin, 2022/12/21
- [PULL 31/41] acpi/tests/avocado/bits: add mformat as one of the dependencies, Michael S. Tsirkin, 2022/12/21
- [PULL 32/41] hw/acpi: Rename tco.c -> ich9_tco.c, Michael S. Tsirkin, 2022/12/21
- [PULL 35/41] hw/virtio: Rename virtio_ss[] -> specific_virtio_ss[], Michael S. Tsirkin, 2022/12/21
- [PULL 38/41] hw/virtio: Extract config read/write accessors to virtio-config-io.c, Michael S. Tsirkin, 2022/12/21
- [PULL 40/41] libvhost-user: Switch to unsigned int for inuse field in struct VuVirtq,
Michael S. Tsirkin <=
- [PULL 41/41] contrib/vhost-user-blk: Replace lseek64 with lseek, Michael S. Tsirkin, 2022/12/21
- [PULL 36/41] hw/virtio: Guard and restrict scope of qmp_virtio_feature_map_t[], Michael S. Tsirkin, 2022/12/21
- [PULL 37/41] hw/virtio: Constify qmp_virtio_feature_map_t[], Michael S. Tsirkin, 2022/12/21
- [PULL 39/41] hw/virtio: Extract QMP related code virtio-qmp.c, Michael S. Tsirkin, 2022/12/21
- Re: [PULL 00/41] virtio,pc,pci: features, cleanups, fixes, Peter Maydell, 2022/12/21