From nobody Sat Oct 25 21:46:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521636772600678.8410490378603; Wed, 21 Mar 2018 05:52:52 -0700 (PDT) Received: from localhost ([::1]:54795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eydEZ-0004MY-PY for importer@patchew.org; Wed, 21 Mar 2018 08:52:51 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 =3D 1; addr_idx =3D 1; while (addr_idx < nchunks) { - if ((tbl_idx =3D=3D (TARGET_PAGE_SIZE / sizeof(uint64_t)))) { + if (tbl_idx =3D=3D (TARGET_PAGE_SIZE / sizeof(uint64_t))) { tbl_idx =3D 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_r= eq *req, rsp->hdr.err =3D rdma_rm_modify_qp(&dev->rdma_dev_res, &dev->backend_d= ev, cmd->qp_handle, cmd->attr_mask, (union ibv_gid *)&cmd->attrs.ah_attr.grh.= dgid, - cmd->attrs.dest_qp_num, cmd->attrs.qp_sta= te, + (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); =20 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 =3D 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)); =20 for (i =3D 0; i < MAX_PORTS; i++) { - dev->rdma_dev_res.ports[i].state =3D PVRDMA_PORT_DOWN; + dev->rdma_dev_res.ports[i].state =3D + (enum ibv_port_state)PVRDMA_PORT_DOWN; =20 dev->rdma_dev_res.ports[i].pkey_tbl =3D g_malloc0(sizeof(*dev->rdma_dev_res.ports[i].pkey_tbl) * --=20 2.13.5