[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/29] libvduse: Switch to unsigned int for inuse field in struct
From: |
Paolo Bonzini |
Subject: |
[PULL 23/29] libvduse: Switch to unsigned int for inuse field in struct VduseVirtq |
Date: |
Tue, 10 Jan 2023 17:02:27 +0100 |
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 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>
Reviewed-by: Xie Yongji <xieyongji@bytedance.com>
Message-Id:
<9fe3fd8b042e048bd04d506ca6e43d738b5c45b7.1671741278.git.marcel@holtmann.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
subprojects/libvduse/libvduse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/subprojects/libvduse/libvduse.c b/subprojects/libvduse/libvduse.c
index c871bd331a6b..338ad5e352e7 100644
--- a/subprojects/libvduse/libvduse.c
+++ b/subprojects/libvduse/libvduse.c
@@ -101,7 +101,7 @@ struct VduseVirtq {
uint16_t signalled_used;
bool signalled_used_valid;
int index;
- int inuse;
+ unsigned int inuse;
bool ready;
int fd;
VduseDev *dev;
--
2.38.1
- Re: [PULL 08/29] gitlab: remove redundant setting of PKG_CONFIG_PATH, (continued)
[PULL 13/29] tests: add G_GNUC_PRINTF for various functions, Paolo Bonzini, 2023/01/10
[PULL 16/29] libvhost-user: Provide _GNU_SOURCE when compiling outside of QEMU, Paolo Bonzini, 2023/01/10
[PULL 18/29] libvhost-user: Cast rc variable to avoid compiler warning, Paolo Bonzini, 2023/01/10
[PULL 19/29] libvhost-user: Use unsigned int i for some for-loop iterations, Paolo Bonzini, 2023/01/10
[PULL 28/29] target/i386: fix operand size of unary SSE operations, Paolo Bonzini, 2023/01/10
[PULL 20/29] libvhost-user: Declare uffdio_register early to make it C90 compliant, Paolo Bonzini, 2023/01/10
[PULL 29/29] configure: remove backwards-compatibility code, Paolo Bonzini, 2023/01/10
[PULL 27/29] libvduse: Add extra compiler warnings, Paolo Bonzini, 2023/01/10
[PULL 23/29] libvduse: Switch to unsigned int for inuse field in struct VduseVirtq,
Paolo Bonzini <=
[PULL 26/29] libvhost-user: Add extra compiler warnings, Paolo Bonzini, 2023/01/10
[PULL 25/29] libvhost-user: Fix assignment in vring_set_avail_event, Paolo Bonzini, 2023/01/10
Re: [PULL 00/29] Misc patches for 2023-01-10, Peter Maydell, 2023/01/10