From patchwork Wed Mar 21 12:40:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 10299417 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A9D17600F6 for ; Wed, 21 Mar 2018 12:52:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90AE629862 for ; Wed, 21 Mar 2018 12:52:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 859D52986A; Wed, 21 Mar 2018 12:52:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1B86C29862 for ; Wed, 21 Mar 2018 12:52:29 +0000 (UTC) Received: from localhost ([::1]:54795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eydEB-0004MY-64 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Mar 2018 08:52:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyd2i-0001lc-GX for qemu-devel@nongnu.org; Wed, 21 Mar 2018 08:40:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyd2f-00045j-EP for qemu-devel@nongnu.org; Wed, 21 Mar 2018 08:40:36 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59422 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eyd2f-00045F-9j for qemu-devel@nongnu.org; Wed, 21 Mar 2018 08:40:33 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BFA1C81A8139; Wed, 21 Mar 2018 12:40:32 +0000 (UTC) Received: from localhost.localdomain (unknown [10.35.206.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71970202322F; Wed, 21 Mar 2018 12:40:27 +0000 (UTC) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Wed, 21 Mar 2018 14:40:26 +0200 Message-Id: <20180321124026.70292-1-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 21 Mar 2018 12:40:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 21 Mar 2018 12:40:32 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH for-2.12] hw/rdma: fix clang compilation errors X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcel@redhat.com, yuval.shaia@oracle.com, mst@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fix some enum castings and extra parentheses. Reported-by: Michael S. Tsirkin Signed-off-by: Marcel Apfelbaum --- hw/rdma/vmw/pvrdma_cmd.c | 5 +++-- hw/rdma/vmw/pvrdma_main.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c index 293dfed29f..25f747a190 100644 --- a/hw/rdma/vmw/pvrdma_cmd.c +++ b/hw/rdma/vmw/pvrdma_cmd.c @@ -73,7 +73,7 @@ static void *pvrdma_map_to_pdir(PCIDevice *pdev, uint64_t pdir_dma, tbl_idx = 1; addr_idx = 1; while (addr_idx < nchunks) { - if ((tbl_idx == (TARGET_PAGE_SIZE / sizeof(uint64_t)))) { + if (tbl_idx == (TARGET_PAGE_SIZE / sizeof(uint64_t))) { tbl_idx = 0; dir_idx++; pr_dbg("Mapping to table %d\n", dir_idx); @@ -507,7 +507,8 @@ static int modify_qp(PVRDMADev *dev, union pvrdma_cmd_req *req, rsp->hdr.err = rdma_rm_modify_qp(&dev->rdma_dev_res, &dev->backend_dev, cmd->qp_handle, cmd->attr_mask, (union ibv_gid *)&cmd->attrs.ah_attr.grh.dgid, - cmd->attrs.dest_qp_num, cmd->attrs.qp_state, + (enum ibv_qp_state)cmd->attrs.dest_qp_num, + (enum ibv_qp_state)cmd->attrs.qp_state, cmd->attrs.qkey, cmd->attrs.rq_psn, cmd->attrs.sq_psn); diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index 99787812ba..0e3469287f 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -91,7 +91,7 @@ static int init_dev_ring(PvrdmaRing *ring, struct pvrdma_ring **ring_state, goto out_free_tbl; } /* RX ring is the second */ - (struct pvrdma_ring *)(*ring_state)++; + (*ring_state)++; rc = pvrdma_ring_init(ring, name, pci_dev, (struct pvrdma_ring *)*ring_state, (num_pages - 1) * TARGET_PAGE_SIZE / @@ -292,7 +292,8 @@ static void init_ports(PVRDMADev *dev, Error **errp) memset(dev->rdma_dev_res.ports, 0, sizeof(dev->rdma_dev_res.ports)); for (i = 0; i < MAX_PORTS; i++) { - dev->rdma_dev_res.ports[i].state = PVRDMA_PORT_DOWN; + dev->rdma_dev_res.ports[i].state = + (enum ibv_port_state)PVRDMA_PORT_DOWN; dev->rdma_dev_res.ports[i].pkey_tbl = g_malloc0(sizeof(*dev->rdma_dev_res.ports[i].pkey_tbl) *