[SLOF] [PATCH v3 01/22] virtio: fix gcc warnings (-Wextra)
Nikunj A Dadhania
nikunj at linux.vnet.ibm.com
Fri Jan 22 21:54:44 AEDT 2016
Change variable types and type case in certain places to fix gcc
warnings
Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
---
lib/libvirtio/virtio-9p.c | 4 ++--
lib/libvirtio/virtio-blk.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/libvirtio/virtio-9p.c b/lib/libvirtio/virtio-9p.c
index 5a5fd01..46bacd6 100644
--- a/lib/libvirtio/virtio-9p.c
+++ b/lib/libvirtio/virtio-9p.c
@@ -143,7 +143,7 @@ static int virtio_9p_transact(void *opaque, uint8_t *tx, int tx_size, uint8_t *r
return -1;
}
- *rx_size = MIN(*rx_size, le32_to_cpu(*(uint32_t*)(&rx[0])));
+ *rx_size = MIN((uint32_t)*rx_size, le32_to_cpu(*(uint32_t*)(&rx[0])));
dprint_buffer("RX", rx, *rx_size);
return 0;
@@ -332,5 +332,5 @@ cleanup_connection:
dprintf("%s : complete, read %llu bytes\n", __func__, offset);
- return rc == 0 ? offset : rc;
+ return rc == 0 ? (int)offset : rc;
}
diff --git a/lib/libvirtio/virtio-blk.c b/lib/libvirtio/virtio-blk.c
index 826f2ea..1e01c14 100644
--- a/lib/libvirtio/virtio-blk.c
+++ b/lib/libvirtio/virtio-blk.c
@@ -93,7 +93,7 @@ virtioblk_read(struct virtio_device *dev, char *buf, long blocknum, long cnt)
int id;
static struct virtio_blk_req blkhdr;
//struct virtio_blk_config *blkconf;
- uint64_t capacity;
+ long capacity;
uint32_t vq_size, time;
struct vring_desc *vq_desc; /* Descriptor vring */
struct vring_avail *vq_avail; /* "Available" vring */
--
2.5.0
More information about the SLOF
mailing list