[PATCH] hw/hyperv: Fix 32-bit build error for vmbus.

Richard Henderson posted 1 patch 3 years, 6 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200906050113.2783642-1-richard.henderson@linaro.org
There is a newer version of this series
hw/hyperv/vmbus.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] hw/hyperv: Fix 32-bit build error for vmbus.
Posted by Richard Henderson 3 years, 6 months ago
../qemu/hw/hyperv/vmbus.c: In function ‘gpadl_iter_io’:
../qemu/hw/hyperv/vmbus.c:383:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  383 |         p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
      |             ^
cc1: all warnings being treated as errors

Fixes: 0d71f7082d7 ("vmbus: vmbus implementation")
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
Cc: Jon Doron <arilou@gmail.com>
---
 hw/hyperv/vmbus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
index 75af6b83dd..3482e9c6cb 100644
--- a/hw/hyperv/vmbus.c
+++ b/hw/hyperv/vmbus.c
@@ -380,7 +380,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
             }
         }
 
-        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
+        p = (void *)(uintptr_t)
+            (((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
         if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
             memcpy(p, buf, cplen);
         } else {
-- 
2.25.1


Re: [PATCH] hw/hyperv: Fix 32-bit build error for vmbus.
Posted by Jon Doron 3 years, 6 months ago
Hi Richard,

I have already submitted this 7 weeks ago
https://patchew.org/QEMU/20200715084326.678715-1-arilou@gmail.com/20200715084326.678715-3-arilou@gmail.com/

On Sun, Sep 6, 2020 at 8:01 AM Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> ../qemu/hw/hyperv/vmbus.c: In function ‘gpadl_iter_io’:
> ../qemu/hw/hyperv/vmbus.c:383:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>   383 |         p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
>       |             ^
> cc1: all warnings being treated as errors
>
> Fixes: 0d71f7082d7 ("vmbus: vmbus implementation")
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> Cc: Jon Doron <arilou@gmail.com>
> ---
>  hw/hyperv/vmbus.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
> index 75af6b83dd..3482e9c6cb 100644
> --- a/hw/hyperv/vmbus.c
> +++ b/hw/hyperv/vmbus.c
> @@ -380,7 +380,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
>              }
>          }
>
> -        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
> +        p = (void *)(uintptr_t)
> +            (((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
>          if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
>              memcpy(p, buf, cplen);
>          } else {
> --
> 2.25.1
>