qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 1/3] libvhost-user: fix cast warnings on 32 b


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH v4 1/3] libvhost-user: fix cast warnings on 32 bits
Date: Tue, 14 May 2019 13:50:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 5/14/19 12:41 PM, Marc-André Lureau wrote:
> Fixes warnings:
>  warning: cast to pointer from integer of different size
>  [-Wint-to-pointer-cast]
> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
>  contrib/libvhost-user/libvhost-user.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/contrib/libvhost-user/libvhost-user.c 
> b/contrib/libvhost-user/libvhost-user.c
> index 74d42177c5..40443a3daa 100644
> --- a/contrib/libvhost-user/libvhost-user.c
> +++ b/contrib/libvhost-user/libvhost-user.c
> @@ -621,7 +621,7 @@ vu_set_mem_table_exec_postcopy(VuDev *dev, VhostUserMsg 
> *vmsg)
>           * data that's already arrived in the shared process.
>           * TODO: How to do hugepage
>           */
> -        ret = madvise((void *)dev_region->mmap_addr,
> +        ret = madvise((void *)(uintptr_t)dev_region->mmap_addr,
>                        dev_region->size + dev_region->mmap_offset,
>                        MADV_DONTNEED);
>          if (ret) {
> @@ -633,7 +633,7 @@ vu_set_mem_table_exec_postcopy(VuDev *dev, VhostUserMsg 
> *vmsg)
>           * in neighbouring pages.
>           * TODO: Turn this backon later.
>           */
> -        ret = madvise((void *)dev_region->mmap_addr,
> +        ret = madvise((void *)(uintptr_t)dev_region->mmap_addr,
>                        dev_region->size + dev_region->mmap_offset,
>                        MADV_NOHUGEPAGE);
>          if (ret) {
> @@ -666,7 +666,7 @@ vu_set_mem_table_exec_postcopy(VuDev *dev, VhostUserMsg 
> *vmsg)
>          DPRINT("%s: region %d: Registered userfault for %llx + %llx\n",
>                  __func__, i, reg_struct.range.start, reg_struct.range.len);
>          /* Now it's registered we can let the client at it */
> -        if (mprotect((void *)dev_region->mmap_addr,
> +        if (mprotect((void *)(uintptr_t)dev_region->mmap_addr,
>                       dev_region->size + dev_region->mmap_offset,
>                       PROT_READ | PROT_WRITE)) {
>              vu_panic(dev, "failed to mprotect region %d for postcopy (%s)",
> 

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]