diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2021-01-27 19:37:02 +1100 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2021-02-12 13:46:16 +1100 |
commit | c79e3375e606c666bda71a840d2afb932bd2813b (patch) | |
tree | 92ba5aa13782ad13aec5a224aa79f89496dea5e5 /lib | |
parent | 7ef3ec384dd3cb622dab42d8a6d3463d107425f6 (diff) | |
download | SLOF-c79e3375e606c666bda71a840d2afb932bd2813b.zip SLOF-c79e3375e606c666bda71a840d2afb932bd2813b.tar.gz SLOF-c79e3375e606c666bda71a840d2afb932bd2813b.tar.bz2 |
virtio: Compile with -Wextra
-Wextra enables a bunch of rather useful checks which this fixes.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libvirtio/p9.c | 8 | ||||
-rw-r--r-- | lib/libvirtio/virtio.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/libvirtio/p9.c b/lib/libvirtio/p9.c index 0e59530..e9ba228 100644 --- a/lib/libvirtio/p9.c +++ b/lib/libvirtio/p9.c @@ -142,7 +142,7 @@ void reset_buffers(void) int p9_transaction(p9_connection_t *connection) { int rc; - int tx_size = GET_SIZE; + uint32_t tx_size = GET_SIZE; uint32_t rx_size = connection->message_size; if (transact == NULL) { @@ -248,7 +248,7 @@ int p9_version(p9_connection_t *connection) int p9_attach(p9_connection_t *connection) { int rc; - int length = 19 + strlen(connection->uname) + strlen(connection->aname); + unsigned length = 19 + strlen(connection->uname) + strlen(connection->aname); if (length > connection->message_size) { return P9_MSG_TOO_LONG; @@ -372,8 +372,8 @@ int p9_walk(p9_connection_t *connection, uint32_t fid, uint32_t new_fid, s_tok = e_tok; continue; } - int tx_size = (e_tok - s_tok + 2 + GET_SIZE); - int rx_size = ((element_count + 1) * MSG_QID_SIZE + unsigned tx_size = (e_tok - s_tok + 2 + GET_SIZE); + unsigned rx_size = ((element_count + 1) * MSG_QID_SIZE + MSG_WALK_RX_HDR_SIZE); if ((tx_size > connection->message_size) || (rx_size > connection->message_size)) { diff --git a/lib/libvirtio/virtio.c b/lib/libvirtio/virtio.c index 69ac439..9dfc93c 100644 --- a/lib/libvirtio/virtio.c +++ b/lib/libvirtio/virtio.c @@ -436,7 +436,7 @@ struct vqs *virtio_queue_init_vq(struct virtio_device *dev, unsigned int id) void virtio_queue_term_vq(struct virtio_device *dev, struct vqs *vq, unsigned int id) { if (vq->desc_gpas) { - int i; + unsigned i; for (i = 0; i < vq->size; ++i) virtio_free_desc(vq, i, dev->features); |