[SLOF] [PATCH v4 02/23] virtio-net: fix gcc warnings (-Wextra)

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Thu Jan 28 21:24:03 AEDT 2016


Change rx_size type which originally should have been uint32_t. This
also requires a change in the function prototype.

Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
---
 lib/libvirtio/p9.c        | 2 +-
 lib/libvirtio/p9.h        | 2 +-
 lib/libvirtio/virtio-9p.c | 6 +++---
 lib/libvirtio/virtio-9p.h | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/libvirtio/p9.c b/lib/libvirtio/p9.c
index a556629..0e59530 100644
--- a/lib/libvirtio/p9.c
+++ b/lib/libvirtio/p9.c
@@ -143,7 +143,7 @@ int p9_transaction(p9_connection_t *connection)
 {
 	int rc;
 	int tx_size = GET_SIZE;
-	int rx_size = connection->message_size;
+	uint32_t rx_size = connection->message_size;
 
 	if (transact == NULL) {
 		return P9_NO_TRANSPORT;
diff --git a/lib/libvirtio/p9.h b/lib/libvirtio/p9.h
index 7df9ef4..3a35e80 100644
--- a/lib/libvirtio/p9.h
+++ b/lib/libvirtio/p9.h
@@ -33,7 +33,7 @@
 #define P9_PARTIAL_WALK			1
 
 typedef int (*p9_transact_t)(void *opaque, uint8_t *tx, int tx_size,
-		uint8_t *rx, int *rx_size);
+		uint8_t *rx, uint32_t *rx_size);
 
 typedef struct {
 	uint32_t message_size;
diff --git a/lib/libvirtio/virtio-9p.c b/lib/libvirtio/virtio-9p.c
index 5a5fd01..95d7db9 100644
--- a/lib/libvirtio/virtio-9p.c
+++ b/lib/libvirtio/virtio-9p.c
@@ -86,7 +86,7 @@ static void dprint_buffer(const char *name, uint8_t *buffer, int length)
  * @return	0 = success, -ve = error.
  */
 static int virtio_9p_transact(void *opaque, uint8_t *tx, int tx_size, uint8_t *rx,
-			      int *rx_size)
+			      uint32_t *rx_size)
 {
 	struct virtio_device *dev = opaque;
 	struct vring_desc *desc;
@@ -228,7 +228,7 @@ void virtio_9p_shutdown(struct virtio_device *dev)
  * @param buffer[out]	Where to read the file to.
  * @return	+ve = amount of data read, -ve = error.
  */
-int virtio_9p_load(struct virtio_device *dev, const char *file_name, uint8_t *buffer)
+long virtio_9p_load(struct virtio_device *dev, const char *file_name, uint8_t *buffer)
 {
 	int rc;
 	uint16_t tag_len;
@@ -332,5 +332,5 @@ cleanup_connection:
 
 
 	dprintf("%s : complete, read %llu bytes\n", __func__, offset);
-	return rc == 0 ? offset : rc;
+	return rc == 0 ? (long)offset : rc;
 }
diff --git a/lib/libvirtio/virtio-9p.h b/lib/libvirtio/virtio-9p.h
index 4bf47d0..db2cf6f 100644
--- a/lib/libvirtio/virtio-9p.h
+++ b/lib/libvirtio/virtio-9p.h
@@ -26,7 +26,7 @@ typedef struct {
 int virtio_9p_init(struct virtio_device *dev, void *tx_buf, void *rx_buf,
 		   int buf_size);
 void virtio_9p_shutdown(struct virtio_device *dev);
-int virtio_9p_load(struct virtio_device *dev, const char *file_name, uint8_t *buffer);
+long virtio_9p_load(struct virtio_device *dev, const char *file_name, uint8_t *buffer);
 
 
 #endif /* VIRTIO_9P_H_ */
-- 
2.5.0



More information about the SLOF mailing list