Patchwork Use signed 16-bit values for ivshmem register writes

login
register
mail settings
Submitter Cam Macdonell
Date Aug. 30, 2010, 4:58 p.m.
Message ID <1283187480-23563-1-git-send-email-cam@cs.ualberta.ca>
Download mbox | patch
Permalink /patch/63114/
State New
Headers show

Comments

Cam Macdonell - Aug. 30, 2010, 4:58 p.m.
fixes gcc 4.1 warning

Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>
---
 hw/ivshmem.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Hidetoshi Seto - Sept. 3, 2010, 1:53 a.m.
(2010/08/31 1:58), Cam Macdonell wrote:
> fixes gcc 4.1 warning
> 
> Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>
> ---
>  hw/ivshmem.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ivshmem.c b/hw/ivshmem.c
> index bbb5cba..fa9c684 100644
> --- a/hw/ivshmem.c
> +++ b/hw/ivshmem.c
> @@ -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

Patch

diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index bbb5cba..fa9c684 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -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;