diff options
author | Yuval Shaia | 2018-03-22 10:52:18 +0100 |
---|---|---|
committer | Marcel Apfelbaum | 2018-03-23 16:38:55 +0100 |
commit | 9bbb8d3577fe302802bfc7e4cf832a39aaa75692 (patch) | |
tree | 923f017f76f331f66495abec4d94e85b05c9c7a9 /hw/rdma/rdma_rm.c | |
parent | hw/rdma: fix clang compilation errors (diff) | |
download | qemu-9bbb8d3577fe302802bfc7e4cf832a39aaa75692.tar.gz qemu-9bbb8d3577fe302802bfc7e4cf832a39aaa75692.tar.xz qemu-9bbb8d3577fe302802bfc7e4cf832a39aaa75692.zip |
hw/rdma: Change host_virt to void *
To avoid compilation warnings on 32-bit machines:
rdma_backend.c: In function 'rdma_backend_create_mr':
rdma_backend.c:409:37: error: cast to pointer from integer of different
size [-Werror=int-to-pointer-cast]
mr->ibmr = ibv_reg_mr(pd->ibpd, (void *)addr, length, access);
Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180322095220.9976-2-yuval.shaia@oracle.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Diffstat (limited to 'hw/rdma/rdma_rm.c')
-rw-r--r-- | hw/rdma/rdma_rm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c index 6d88ac5d23..b4938169b6 100644 --- a/hw/rdma/rdma_rm.c +++ b/hw/rdma/rdma_rm.c @@ -146,7 +146,7 @@ int rdma_rm_alloc_mr(RdmaDeviceResources *dev_res, uint32_t pd_handle, RdmaRmMR *mr; int ret = 0; RdmaRmPD *pd; - uint64_t addr; + void *addr; size_t length; pd = rdma_rm_get_pd(dev_res, pd_handle); @@ -165,10 +165,10 @@ int rdma_rm_alloc_mr(RdmaDeviceResources *dev_res, uint32_t pd_handle, /* TODO: This is my guess but not so sure that this needs to be * done */ length = TARGET_PAGE_SIZE; - addr = (uint64_t)g_malloc(length); + addr = g_malloc(length); } else { - mr->user_mr.host_virt = (uint64_t) host_virt; - pr_dbg("host_virt=0x%lx\n", mr->user_mr.host_virt); + mr->user_mr.host_virt = host_virt; + pr_dbg("host_virt=0x%p\n", mr->user_mr.host_virt); mr->user_mr.length = guest_length; pr_dbg("length=0x%lx\n", guest_length); mr->user_mr.guest_start = guest_start; @@ -216,7 +216,7 @@ void rdma_rm_dealloc_mr(RdmaDeviceResources *dev_res, uint32_t mr_handle) if (mr) { rdma_backend_destroy_mr(&mr->backend_mr); - munmap((void *)mr->user_mr.host_virt, mr->user_mr.length); + munmap(mr->user_mr.host_virt, mr->user_mr.length); res_tbl_dealloc(&dev_res->mr_tbl, mr_handle); } } |