diff options
author | Yuval Shaia <yuval.shaia@oracle.com> | 2018-03-22 11:52:20 +0200 |
---|---|---|
committer | Marcel Apfelbaum <marcel@redhat.com> | 2018-03-23 18:38:55 +0300 |
commit | 6f559013c86d16255991ca23e47bd161407b95c8 (patch) | |
tree | 8aa0a99fcf9c3f39cd53bac8722d586846bd2144 /hw/rdma/rdma_backend.c | |
parent | 94f480b8db137ee499c7457dbcf7eb6e1ef5b482 (diff) |
hw/rdma: Fix 32-bit compilation
Use the correct printf formats, so that a 32-bit compile doesn't spit
out lots of warnings about %lx being incompatible with uint64_t.
Suggested-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-4-yuval.shaia@oracle.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Diffstat (limited to 'hw/rdma/rdma_backend.c')
-rw-r--r-- | hw/rdma/rdma_backend.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index 1dbb17bd2e..5c7b3d8949 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -62,12 +62,13 @@ static void poll_cq(RdmaDeviceResources *rdma_dev_res, struct ibv_cq *ibcq) pr_dbg("Got %d completion(s) from cq %p\n", ne, ibcq); for (i = 0; i < ne; i++) { - pr_dbg("wr_id=0x%lx\n", wc[i].wr_id); + pr_dbg("wr_id=0x%" PRIx64 "\n", wc[i].wr_id); pr_dbg("status=%d\n", wc[i].status); bctx = rdma_rm_get_cqe_ctx(rdma_dev_res, wc[i].wr_id); if (unlikely(!bctx)) { - pr_dbg("Error: Failed to find ctx for req %ld\n", wc[i].wr_id); + pr_dbg("Error: Failed to find ctx for req %" PRId64 "\n", + wc[i].wr_id); continue; } pr_dbg("Processing %s CQE\n", bctx->is_tx_req ? "send" : "recv"); @@ -176,7 +177,7 @@ static struct ibv_ah *create_ah(RdmaBackendDev *backend_dev, struct ibv_pd *pd, g_hash_table_insert(ah_hash, ah_key, ah); } else { g_bytes_unref(ah_key); - pr_dbg("ibv_create_ah failed for gid <%lx %lx>\n", + pr_dbg("Fail to create AH for gid <0x%" PRIx64 ", 0x%" PRIx64 ">\n", be64_to_cpu(dgid->global.subnet_prefix), be64_to_cpu(dgid->global.interface_id)); } @@ -227,8 +228,8 @@ static int build_host_sge_array(RdmaDeviceResources *rdma_dev_res, dsge->length = ssge[ssge_idx].length; dsge->lkey = rdma_backend_mr_lkey(&mr->backend_mr); - pr_dbg("ssge->addr=0x%lx\n", (uint64_t)ssge[ssge_idx].addr); - pr_dbg("dsge->addr=0x%lx\n", dsge->addr); + pr_dbg("ssge->addr=0x%" PRIx64 "\n", ssge[ssge_idx].addr); + pr_dbg("dsge->addr=0x%" PRIx64 "\n", dsge->addr); pr_dbg("dsge->length=%d\n", dsge->length); pr_dbg("dsge->lkey=0x%x\n", dsge->lkey); @@ -405,7 +406,7 @@ int rdma_backend_create_mr(RdmaBackendMR *mr, RdmaBackendPD *pd, void *addr, size_t length, int access) { pr_dbg("addr=0x%p\n", addr); - pr_dbg("len=%ld\n", length); + pr_dbg("len=%zu\n", length); mr->ibmr = ibv_reg_mr(pd->ibpd, addr, length, access); if (mr->ibmr) { pr_dbg("lkey=0x%x\n", mr->ibmr->lkey); @@ -562,7 +563,7 @@ int rdma_backend_qp_state_rtr(RdmaBackendDev *backend_dev, RdmaBackendQP *qp, switch (qp_type) { case IBV_QPT_RC: - pr_dbg("dgid=0x%lx,%lx\n", + pr_dbg("dgid=0x%" PRIx64 ",%" PRIx64 "\n", be64_to_cpu(ibv_gid.global.subnet_prefix), be64_to_cpu(ibv_gid.global.interface_id)); pr_dbg("dqpn=0x%x\n", dqpn); @@ -681,7 +682,7 @@ static int init_device_caps(RdmaBackendDev *backend_dev, return -EIO; } - CHK_ATTR(dev_attr, backend_dev->dev_attr, max_mr_size, "%ld"); + CHK_ATTR(dev_attr, backend_dev->dev_attr, max_mr_size, "%" PRId64); CHK_ATTR(dev_attr, backend_dev->dev_attr, max_qp, "%d"); CHK_ATTR(dev_attr, backend_dev->dev_attr, max_sge, "%d"); CHK_ATTR(dev_attr, backend_dev->dev_attr, max_qp_wr, "%d"); @@ -794,9 +795,9 @@ int rdma_backend_init(RdmaBackendDev *backend_dev, ret = -EIO; goto out_destroy_comm_channel; } - pr_dbg("subnet_prefix=0x%lx\n", + pr_dbg("subnet_prefix=0x%" PRIx64 "\n", be64_to_cpu(backend_dev->gid.global.subnet_prefix)); - pr_dbg("interface_id=0x%lx\n", + pr_dbg("interface_id=0x%" PRIx64 "\n", be64_to_cpu(backend_dev->gid.global.interface_id)); snprintf(thread_name, sizeof(thread_name), "rdma_comp_%s", |