diff mbox

[v2,11/13] Use unsigned types for the 'len' argument of all memory read/write functions

Message ID 1456847859-4771-11-git-send-email-martin.galvan@tallertechnologies.com (mailing list archive)
State New, archived
Headers show

Commit Message

Martin Galvan March 1, 2016, 3:57 p.m. UTC
---
 hw/net/vmware_utils.h | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

--
2.7.1
diff mbox

Patch

diff --git a/hw/net/vmware_utils.h b/hw/net/vmware_utils.h
index c0dbb2f..6887178 100644
--- a/hw/net/vmware_utils.h
+++ b/hw/net/vmware_utils.h
@@ -26,33 +26,34 @@ 
  *
  */
 static inline void
-vmw_shmem_read(hwaddr addr, void *buf, int len)
+vmw_shmem_read(hwaddr addr, void *buf, size_t len)
 {
-    VMW_SHPRN("SHMEM r: %" PRIx64 ", len: %d to %p", addr, len, buf);
+    VMW_SHPRN("SHMEM r: %" PRIx64 ", len: %zu to %p", addr, len, buf);
     cpu_physical_memory_read(addr, buf, len);
 }

 static inline void
-vmw_shmem_write(hwaddr addr, void *buf, int len)
+vmw_shmem_write(hwaddr addr, void *buf, size_t len)
 {
-    VMW_SHPRN("SHMEM w: %" PRIx64 ", len: %d to %p", addr, len, buf);
+    VMW_SHPRN("SHMEM w: %" PRIx64 ", len: %zu to %p", addr, len, buf);
     cpu_physical_memory_write(addr, buf, len);
 }

 static inline void
-vmw_shmem_rw(hwaddr addr, void *buf, int len, int is_write)
+vmw_shmem_rw(hwaddr addr, void *buf, size_t len, int is_write)
 {
-    VMW_SHPRN("SHMEM r/w: %" PRIx64 ", len: %d (to %p), is write: %d",
+    VMW_SHPRN("SHMEM r/w: %" PRIx64 ", len: %zu (to %p), is write: %d",
               addr, len, buf, is_write);

     cpu_physical_memory_rw(addr, buf, len, is_write);
 }

 static inline void
-vmw_shmem_set(hwaddr addr, uint8_t val, int len)
+vmw_shmem_set(hwaddr addr, uint8_t val, size_t len)
 {
     int i;
-    VMW_SHPRN("SHMEM set: %" PRIx64 ", len: %d (value 0x%X)", addr, len, val);
+    VMW_SHPRN("SHMEM set: %" PRIx64 ", len: %zu (value 0x%X)", addr,
+        len, val);

     for (i = 0; i < len; i++) {
         cpu_physical_memory_write(addr + i, &val, 1);