From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6620F568F for ; Thu, 19 Mar 2015 11:43:32 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 19 Mar 2015 03:43:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,429,1422950400"; d="scan'208";a="682393098" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 19 Mar 2015 03:43:30 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t2JAhTuh022585; Thu, 19 Mar 2015 18:43:29 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t2JAhQdm023030; Thu, 19 Mar 2015 18:43:28 +0800 Received: (from hxie5@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t2JAhQpB023026; Thu, 19 Mar 2015 18:43:26 +0800 From: Huawei Xie To: dev@dpdk.org Date: Thu, 19 Mar 2015 18:43:24 +0800 Message-Id: <1426761804-22995-1-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] lib/librte_vhost: fix build errors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2015 10:43:32 -0000 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 --- 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