From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PULL 1/3] libvhost-user: fix cast warnings on 32 bits
Date: Wed, 22 May 2019 10:27:15 +0200 [thread overview]
Message-ID: <20190522082717.9354-2-kraxel@redhat.com> (raw)
In-Reply-To: <20190522082717.9354-1-kraxel@redhat.com>
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Fixes warnings:
warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190514104126.6294-2-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
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 3825b1cacff5..0ffa0f45c890 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)",
--
2.18.1
next prev parent reply other threads:[~2019-05-22 8:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-22 8:27 [Qemu-devel] [PULL 0/3] Input 20190522 patches Gerd Hoffmann
2019-05-22 8:27 ` Gerd Hoffmann [this message]
2019-05-22 8:27 ` [Qemu-devel] [PULL 2/3] libvhost-user: fix -Werror=format= on ppc64 Gerd Hoffmann
2019-05-22 8:27 ` [Qemu-devel] [PULL 3/3] contrib: add vhost-user-input Gerd Hoffmann
2019-05-30 11:16 ` Peter Maydell
2019-06-05 13:49 ` Marc-André Lureau
2019-05-23 10:21 ` [Qemu-devel] [PULL 0/3] Input 20190522 patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190522082717.9354-2-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).