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/vmw | |
parent | 94f480b8db137ee499c7457dbcf7eb6e1ef5b482 (diff) | |
download | qemu-6f559013c86d16255991ca23e47bd161407b95c8.zip qemu-6f559013c86d16255991ca23e47bd161407b95c8.tar.gz qemu-6f559013c86d16255991ca23e47bd161407b95c8.tar.bz2 |
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/vmw')
-rw-r--r-- | hw/rdma/vmw/pvrdma_cmd.c | 8 | ||||
-rw-r--r-- | hw/rdma/vmw/pvrdma_dev_ring.c | 6 | ||||
-rw-r--r-- | hw/rdma/vmw/pvrdma_dev_ring.h | 2 | ||||
-rw-r--r-- | hw/rdma/vmw/pvrdma_main.c | 25 | ||||
-rw-r--r-- | hw/rdma/vmw/pvrdma_qp_ops.c | 6 |
5 files changed, 24 insertions, 23 deletions
diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c index 5bd4643..99019d8 100644 --- a/hw/rdma/vmw/pvrdma_cmd.c +++ b/hw/rdma/vmw/pvrdma_cmd.c @@ -85,7 +85,7 @@ static void *pvrdma_map_to_pdir(PCIDevice *pdev, uint64_t pdir_dma, } } - pr_dbg("guest_dma[%d]=0x%lx\n", addr_idx, tbl[tbl_idx]); + pr_dbg("guest_dma[%d]=0x%" PRIx64 "\n", addr_idx, tbl[tbl_idx]); curr_page = rdma_pci_dma_map(pdev, (dma_addr_t)tbl[tbl_idx], TARGET_PAGE_SIZE); @@ -285,7 +285,7 @@ static int create_cq_ring(PCIDevice *pci_dev , PvrdmaRing **ring, goto out_free_ring; } - sprintf(ring_name, "cq_ring_%lx", pdir_dma); + sprintf(ring_name, "cq_ring_%" PRIx64, pdir_dma); rc = pvrdma_ring_init(r, ring_name, pci_dev, &r->ring_state[1], cqe, sizeof(struct pvrdma_cqe), /* first page is ring state */ @@ -415,7 +415,7 @@ static int create_qp_rings(PCIDevice *pci_dev, uint64_t pdir_dma, wqe_sz = pow2ceil(sizeof(struct pvrdma_sq_wqe_hdr) + sizeof(struct pvrdma_sge) * smax_sge - 1); - sprintf(ring_name, "qp_sring_%lx", pdir_dma); + sprintf(ring_name, "qp_sring_%" PRIx64, pdir_dma); rc = pvrdma_ring_init(sr, ring_name, pci_dev, sr->ring_state, scqe, wqe_sz, (dma_addr_t *)&tbl[1], spages); if (rc) { @@ -426,7 +426,7 @@ static int create_qp_rings(PCIDevice *pci_dev, uint64_t pdir_dma, rr->ring_state = &sr->ring_state[1]; wqe_sz = pow2ceil(sizeof(struct pvrdma_rq_wqe_hdr) + sizeof(struct pvrdma_sge) * rmax_sge - 1); - sprintf(ring_name, "qp_rring_%lx", pdir_dma); + sprintf(ring_name, "qp_rring_%" PRIx64, pdir_dma); rc = pvrdma_ring_init(rr, ring_name, pci_dev, rr->ring_state, rcqe, wqe_sz, (dma_addr_t *)&tbl[1 + spages], rpages); if (rc) { diff --git a/hw/rdma/vmw/pvrdma_dev_ring.c b/hw/rdma/vmw/pvrdma_dev_ring.c index ff19a9e..01247fc 100644 --- a/hw/rdma/vmw/pvrdma_dev_ring.c +++ b/hw/rdma/vmw/pvrdma_dev_ring.c @@ -23,7 +23,7 @@ int pvrdma_ring_init(PvrdmaRing *ring, const char *name, PCIDevice *dev, struct pvrdma_ring *ring_state, uint32_t max_elems, - size_t elem_sz, dma_addr_t *tbl, dma_addr_t npages) + size_t elem_sz, dma_addr_t *tbl, uint32_t npages) { int i; int rc = 0; @@ -35,8 +35,8 @@ int pvrdma_ring_init(PvrdmaRing *ring, const char *name, PCIDevice *dev, ring->ring_state = ring_state; ring->max_elems = max_elems; ring->elem_sz = elem_sz; - pr_dbg("ring->elem_sz=%ld\n", ring->elem_sz); - pr_dbg("npages=%ld\n", npages); + pr_dbg("ring->elem_sz=%zu\n", ring->elem_sz); + pr_dbg("npages=%d\n", npages); /* TODO: Give a moment to think if we want to redo driver settings atomic_set(&ring->ring_state->prod_tail, 0); atomic_set(&ring->ring_state->cons_head, 0); diff --git a/hw/rdma/vmw/pvrdma_dev_ring.h b/hw/rdma/vmw/pvrdma_dev_ring.h index 2d0461f..411d244 100644 --- a/hw/rdma/vmw/pvrdma_dev_ring.h +++ b/hw/rdma/vmw/pvrdma_dev_ring.h @@ -32,7 +32,7 @@ typedef struct PvrdmaRing { int pvrdma_ring_init(PvrdmaRing *ring, const char *name, PCIDevice *dev, struct pvrdma_ring *ring_state, uint32_t max_elems, - size_t elem_sz, dma_addr_t *tbl, dma_addr_t npages); + size_t elem_sz, dma_addr_t *tbl, uint32_t npages); void *pvrdma_ring_next_elem_read(PvrdmaRing *ring); void pvrdma_ring_read_inc(PvrdmaRing *ring); void *pvrdma_ring_next_elem_write(PvrdmaRing *ring); diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index 44de6a4..c552248 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -236,7 +236,7 @@ static void init_dsr_dev_caps(PVRDMADev *dev) dsr = dev->dsr_info.dsr; dsr->caps.fw_ver = PVRDMA_FW_VERSION; - pr_dbg("fw_ver=0x%lx\n", dsr->caps.fw_ver); + pr_dbg("fw_ver=0x%" PRIx64 "\n", dsr->caps.fw_ver); dsr->caps.mode = PVRDMA_DEVICE_MODE_ROCE; pr_dbg("mode=%d\n", dsr->caps.mode); @@ -261,11 +261,10 @@ static void init_dsr_dev_caps(PVRDMADev *dev) pr_dbg("gid_tbl_len=%d\n", dsr->caps.gid_tbl_len); dsr->caps.sys_image_guid = 0; - pr_dbg("sys_image_guid=%lx\n", dsr->caps.sys_image_guid); + pr_dbg("sys_image_guid=%" PRIx64 "\n", dsr->caps.sys_image_guid); dsr->caps.node_guid = cpu_to_be64(dev->node_guid); - pr_dbg("node_guid=%llx\n", - (long long unsigned int)be64_to_cpu(dsr->caps.node_guid)); + pr_dbg("node_guid=%" PRIx64 "\n", be64_to_cpu(dsr->caps.node_guid)); dsr->caps.phys_port_cnt = MAX_PORTS; pr_dbg("phys_port_cnt=%d\n", dsr->caps.phys_port_cnt); @@ -343,8 +342,8 @@ static void regs_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) /* pr_dbg("addr=0x%lx, val=0x%x, size=%d\n", addr, (uint32_t)val, size); */ if (set_reg_val(dev, addr, val)) { - pr_err("Error trying to set REG value, addr=0x%lx, val=0x%lx\n", - (uint64_t)addr, val); + pr_err("Fail to set REG value, addr=0x%" PRIx64 ", val=0x%" PRIx64 "\n", + addr, val); return; } @@ -373,7 +372,7 @@ static void regs_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) } break; case PVRDMA_REG_IMR: - pr_dbg("Interrupt mask=0x%lx\n", val); + pr_dbg("Interrupt mask=0x%" PRIx64 "\n", val); dev->interrupt_mask = val; break; case PVRDMA_REG_REQUEST: @@ -404,7 +403,8 @@ static void uar_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) switch (addr & 0xFFF) { /* Mask with 0xFFF as each UC gets page */ case PVRDMA_UAR_QP_OFFSET: - pr_dbg("UAR QP command, addr=0x%x, val=0x%lx\n", (uint32_t)addr, val); + pr_dbg("UAR QP command, addr=0x%" PRIx64 ", val=0x%" PRIx64 "\n", + (uint64_t)addr, val); if (val & PVRDMA_UAR_QP_SEND) { pvrdma_qp_send(dev, val & PVRDMA_UAR_HANDLE_MASK); } @@ -420,16 +420,17 @@ static void uar_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) !!(val & PVRDMA_UAR_CQ_ARM_SOL)); } if (val & PVRDMA_UAR_CQ_ARM_SOL) { - pr_dbg("UAR_CQ_ARM_SOL (%ld)\n", val & PVRDMA_UAR_HANDLE_MASK); + pr_dbg("UAR_CQ_ARM_SOL (%" PRIx64 ")\n", + val & PVRDMA_UAR_HANDLE_MASK); } if (val & PVRDMA_UAR_CQ_POLL) { - pr_dbg("UAR_CQ_POLL (%ld)\n", val & PVRDMA_UAR_HANDLE_MASK); + pr_dbg("UAR_CQ_POLL (%" PRIx64 ")\n", val & PVRDMA_UAR_HANDLE_MASK); pvrdma_cq_poll(&dev->rdma_dev_res, val & PVRDMA_UAR_HANDLE_MASK); } break; default: - pr_err("Unsupported command, addr=0x%lx, val=0x%lx\n", - (uint64_t)addr, val); + pr_err("Unsupported command, addr=0x%" PRIx64 ", val=0x%" PRIx64 "\n", + addr, val); break; } } diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c index a693c06..750ade6 100644 --- a/hw/rdma/vmw/pvrdma_qp_ops.c +++ b/hw/rdma/vmw/pvrdma_qp_ops.c @@ -102,7 +102,7 @@ static void pvrdma_qp_ops_comp_handler(int status, unsigned int vendor_err, CompHandlerCtx *comp_ctx = (CompHandlerCtx *)ctx; pr_dbg("cq_handle=%d\n", comp_ctx->cq_handle); - pr_dbg("wr_id=%ld\n", comp_ctx->cqe.wr_id); + pr_dbg("wr_id=%" PRIx64 "\n", comp_ctx->cqe.wr_id); pr_dbg("status=%d\n", status); pr_dbg("vendor_err=0x%x\n", vendor_err); comp_ctx->cqe.status = status; @@ -143,7 +143,7 @@ int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle) while (wqe) { CompHandlerCtx *comp_ctx; - pr_dbg("wr_id=%ld\n", wqe->hdr.wr_id); + pr_dbg("wr_id=%" PRIx64 "\n", wqe->hdr.wr_id); /* Prepare CQE */ comp_ctx = g_malloc(sizeof(CompHandlerCtx)); @@ -187,7 +187,7 @@ int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle) while (wqe) { CompHandlerCtx *comp_ctx; - pr_dbg("wr_id=%ld\n", wqe->hdr.wr_id); + pr_dbg("wr_id=%" PRIx64 "\n", wqe->hdr.wr_id); /* Prepare CQE */ comp_ctx = g_malloc(sizeof(CompHandlerCtx)); |