iov: add const annotation
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 24 Sep 2012 10:50:32 +0000 (12:50 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 28 Sep 2012 10:16:27 +0000 (12:16 +0200)
iov_from_buf does not change iov, make it const.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
iov.c
iov.h

diff --git a/iov.c b/iov.c
index 60705c73ab118d390383d2b94b2a806b37927fee..c6a66f0afe2a584e8af548d1601016ee8b6d513d 100644 (file)
--- a/iov.c
+++ b/iov.c
@@ -26,7 +26,7 @@
 # include <sys/socket.h>
 #endif
 
-size_t iov_from_buf(struct iovec *iov, unsigned int iov_cnt,
+size_t iov_from_buf(const struct iovec *iov, unsigned int iov_cnt,
                     size_t offset, const void *buf, size_t bytes)
 {
     size_t done;
diff --git a/iov.h b/iov.h
index 381f37a5463f189230ff382b53c4bcf0d7b96df9..a73569f94eeed6a35345515d6b5187f37b6f3066 100644 (file)
--- a/iov.h
+++ b/iov.h
@@ -36,7 +36,7 @@ size_t iov_size(const struct iovec *iov, const unsigned int iov_cnt);
  * such "large" value is -1 (sinice size_t is unsigned),
  * so specifying `-1' as `bytes' means 'up to the end of iovec'.
  */
-size_t iov_from_buf(struct iovec *iov, unsigned int iov_cnt,
+size_t iov_from_buf(const struct iovec *iov, unsigned int iov_cnt,
                     size_t offset, const void *buf, size_t bytes);
 size_t iov_to_buf(const struct iovec *iov, const unsigned int iov_cnt,
                   size_t offset, void *buf, size_t bytes);