[PATCH] fix qcow.c compiler warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change bdev->blocksize to signed, used in comparison <= 0 in qcow_open().
Change iovec_segment() and iovec_memset() to be static functions.
define _GNU_SOURCE 1 to match -D_GNU_SOURCE
---
 qcow.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/qcow.c b/qcow.c
index 9f108ae..d6b2bd2 100644
--- a/qcow.c
+++ b/qcow.c
@@ -44,7 +44,7 @@
  * THE SOFTWARE.
  */
 
-#define _GNU_SOURCE
+#define _GNU_SOURCE 1
 #include <stddef.h>
 #include <stdint.h>
 #include <stdbool.h>
@@ -89,7 +89,7 @@ struct bdev {
 	/* from TCMU configfs configuration */
 	int64_t size;
 	uint64_t num_lbas;
-	uint32_t block_size;
+	int32_t block_size;
 
 	int fd;		/* image file descriptor */
 };
@@ -1167,7 +1167,7 @@ out:
 }
 
 /* returns number of iovs initialized in seg */
-size_t iovec_segment(struct iovec *iov, struct iovec *seg, size_t off, size_t len)
+static size_t iovec_segment(struct iovec *iov, struct iovec *seg, size_t off, size_t len)
 {
 	struct iovec *seg_start = seg;
 
@@ -1195,7 +1195,7 @@ size_t iovec_segment(struct iovec *iov, struct iovec *seg, size_t off, size_t le
 	return seg - seg_start;
 }
 
-void iovec_memset(struct iovec *iov, int iovcnt, int c, size_t len)
+static void iovec_memset(struct iovec *iov, int iovcnt, int c, size_t len)
 {
 	while (len && iovcnt) {
 		size_t n = min(iov->iov_len, len);
-- 
2.12.2.575.gb14f27f

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux