DPDK patches and discussions
 help / color / mirror / Atom feed
From: Huawei Xie <huawei.xie@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] lib/librte_vhost: fix build errors
Date: Thu, 19 Mar 2015 18:43:24 +0800	[thread overview]
Message-ID: <1426761804-22995-1-git-send-email-huawei.xie@intel.com> (raw)

fix the error "missing initializer" and "cast to pointer from integer of different size".

For the pointer to integer cast issue, need to investigate changing the typeof mapped_address.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
---
 lib/librte_vhost/vhost_user/vhost-net-user.c  | 2 +-
 lib/librte_vhost/vhost_user/virtio-net-user.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c b/lib/librte_vhost/vhost_user/vhost-net-user.c
index 3aa9436..31f1215 100644
--- a/lib/librte_vhost/vhost_user/vhost-net-user.c
+++ b/lib/librte_vhost/vhost_user/vhost-net-user.c
@@ -277,7 +277,7 @@ vserver_new_vq_conn(int fd, void *dat, __rte_unused int *remove)
 	int conn_fd;
 	struct connfd_ctx *ctx;
 	int fh;
-	struct vhost_device_ctx vdev_ctx = { 0 };
+	struct vhost_device_ctx vdev_ctx = { (pid_t)0, 0 };
 	unsigned int size;
 
 	conn_fd = accept(fd, NULL, NULL);
diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c b/lib/librte_vhost/vhost_user/virtio-net-user.c
index 465d3ef..c1ffc38 100644
--- a/lib/librte_vhost/vhost_user/virtio-net-user.c
+++ b/lib/librte_vhost/vhost_user/virtio-net-user.c
@@ -83,7 +83,7 @@ free_mem_region(struct virtio_net *dev)
 	for (idx = 0; idx < dev->mem->nregions; idx++) {
 		if (region[idx].mapped_address) {
 			alignment = region[idx].blksz;
-			munmap((void *)
+			munmap((void *)(uintptr_t)
 				RTE_ALIGN_FLOOR(
 					region[idx].mapped_address, alignment),
 				RTE_ALIGN_CEIL(
@@ -155,7 +155,7 @@ user_set_mem_table(struct vhost_device_ctx ctx, struct VhostUserMsg *pmsg)
 
 		RTE_LOG(INFO, VHOST_CONFIG,
 			"mapped region %d fd:%d to %p sz:0x%"PRIx64" off:0x%"PRIx64"\n",
-			idx, pmsg->fds[idx], (void *)mapped_address,
+			idx, pmsg->fds[idx], (void *)(uintptr_t)mapped_address,
 			mapped_size, memory.regions[idx].mmap_offset);
 
 		if (mapped_address == (uint64_t)(uintptr_t)MAP_FAILED) {
@@ -194,7 +194,7 @@ user_set_mem_table(struct vhost_device_ctx ctx, struct VhostUserMsg *pmsg)
 err_mmap:
 	while (idx--) {
 		alignment = pregion_orig[idx].blksz;
-		munmap((void *)RTE_ALIGN_FLOOR(
+		munmap((void *)(uintptr_t)RTE_ALIGN_FLOOR(
 			pregion_orig[idx].mapped_address, alignment),
 			RTE_ALIGN_CEIL(pregion_orig[idx].mapped_size,
 					alignment));
-- 
1.8.1.4

             reply	other threads:[~2015-03-19 10:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 10:43 Huawei Xie [this message]
2015-03-20  1:18 ` Ouyang, Changchun
2015-03-20 22:01   ` Thomas Monjalon

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=1426761804-22995-1-git-send-email-huawei.xie@intel.com \
    --to=huawei.xie@intel.com \
    --cc=dev@dpdk.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).