Skip to contentSkip to conversation

Use signed 16-bit values for ivshmem register writes

PATCH In review Cam Macdonell 2 participants 2 messages Aug 30, 2010 – Sep 3, 2010 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use signed 16-bit values for ivshmem register writes

fixes gcc 4.1 warning

---
 hw/ivshmem.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/ivshmem.c +2 -2
index bbb5cba..fa9c684 100644
@@ -181,8 +181,8 @@ static void ivshmem_io_writel(void *opaque, target_phys_addr_t addr,
     IVShmemState *s = opaque;
 
     uint64_t write_one = 1;
-    uint16_t dest = val >> 16;
-    uint16_t vector = val & 0xff;
+    int16_t dest = val >> 16;
+    int16_t vector = val & 0xff;
 
     addr &= 0xfc;
 
Signature · 1 line
1.6.6.1
#1 lore raw
Quoted 12 lines · Cam Macdonell

fixes gcc 4.1 warning

---
 hw/ivshmem.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/ivshmem.c +0 -0
index bbb5cba..fa9c684 100644

hw/ivshmem.c static void ivshmem_io_writel(void *opaque, target_phys_addr_t addr, · line 188

Quoted 10 lines
hw/ivshmem.c +2 -2
@@ -181,8 +181,8 @@ static void ivshmem_io_writel(void *opaque, target_phys_addr_t addr,
     IVShmemState *s = opaque;
 
     uint64_t write_one = 1;
-    uint16_t dest = val >> 16;
-    uint16_t vector = val & 0xff;
+    int16_t dest = val >> 16;
+    int16_t vector = val & 0xff;
 
     addr &= 0xfc;
 

Since val is uint32_t, I think this change doesn't make sense.

Thanks,
H.Seto