From nobody Mon Feb 9 17:37:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552578083161761.7594965348358; Thu, 14 Mar 2019 08:41:23 -0700 (PDT) Received: from localhost ([127.0.0.1]:39801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4STv-0005DH-UV for importer@patchew.org; Thu, 14 Mar 2019 11:41:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4SJq-0006Au-Fa for qemu-devel@nongnu.org; Thu, 14 Mar 2019 11:31:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4SJm-0006Rl-2P for qemu-devel@nongnu.org; Thu, 14 Mar 2019 11:30:54 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:55741) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h4SJl-0006PI-NX for qemu-devel@nongnu.org; Thu, 14 Mar 2019 11:30:49 -0400 Received: by mail-wm1-x342.google.com with SMTP id 4so3441059wmf.5 for ; Thu, 14 Mar 2019 08:30:47 -0700 (PDT) Received: from kheib-workstation.redhat.com ([192.116.94.220]) by smtp.gmail.com with ESMTPSA id d9sm32070909wrn.72.2019.03.14.08.30.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Mar 2019 08:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D2aL715eOWt7FUxRDxeN32jprGibo/7klbnwp25m0g4=; b=a4+Ja/omQxkVBXaGnbe5XPzura4ub1vbClYj10g78eA5fsRIE1ic6Sp6HEfKz07eFl G4qZPTDgbzX3NnE5h8EyzG41ZVR00SW89cscMcEkny8JnHIdgCSB2pN9Rsw0+B6L5B2M 9fsUbdOx6pSc0dT9rAgaKNEAFyDhYSexRetp4AHNSG3TWT4YPD6UXRi5/FgDM/lIxJKM S3m1oa3dtStLmQrmyhMqpetkLrtHP39S/GnV9sgjV4ViRHvhCG88/2CLqdPvbMcdEyvL K/xuUL1FzgRlbK42dnBPJUBI3LHhztbvg6oImr5b3MYdqCvFh6x/N1YqELbsaPcM+EkH l2WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D2aL715eOWt7FUxRDxeN32jprGibo/7klbnwp25m0g4=; b=rtFSOTr/0GGmMbfteIEmHReCSFuGHPWQLgrGJIS/RwU2NJKE62hLcWne0SaFjUycgC fMUkc7Df68z9ku3qd/GZpstoLiB7tNW3KJaMpaOKSuH60GvpcQdp+FBF5RVq5SrVm7MR YQWfiye1Rqsits61jt/TeyEsniH6vQYLoOGxr7fA6QSuj8ucad2qI6gOvrK9L0Vtp01t AQsacJkuvsQkM/MoaJS1TTaIbmhMPn5VH+OPmxU+xr8NfrMhbeypf2no850R6hzTeAHN wfLeKNBAaMYvTxZCByUT/VBuEdufJTOuJ4QXWrGNNCDmIoN/2C+zLB5JrCxXvzcD8BQD zV+A== X-Gm-Message-State: APjAAAVa+K3UyQU8wsXcqeAHyJAJUHgllaDDhyqLk7vQbzXyIzSKPPLw JQJhnUrrRr3SdKKnOxPETBXwmfDB X-Google-Smtp-Source: APXvYqwcHG1Al+Fhi9AtD96iNMTY50XyAHa4d1dPQKjko5nN1MtRGgOYCf/a0gFGZ8b9cQnoGIiotw== X-Received: by 2002:a7b:ce83:: with SMTP id q3mr2959484wmj.108.1552577446049; Thu, 14 Mar 2019 08:30:46 -0700 (PDT) From: Kamal Heib To: qemu-devel@nongnu.org Date: Thu, 14 Mar 2019 17:30:30 +0200 Message-Id: <20190314153031.7197-4-kamalheib1@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190314153031.7197-1-kamalheib1@gmail.com> References: <20190314153031.7197-1-kamalheib1@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 Subject: [Qemu-devel] [PATCH v2 3/4] hw/rdma: Use {} instead of {0} 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: Kamal Heib , Yuval Shaia Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Initialize structs with {} instead of {0} to make sure that all code is using the same convention. Reviewed-by: Marcel Apfelbaum Signed-off-by: Kamal Heib Reviewed-by: Yuval Shaia --- hw/rdma/rdma_backend.c | 18 +++++++++--------- hw/rdma/vmw/pvrdma_cmd.c | 2 +- hw/rdma/vmw/pvrdma_qp_ops.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index 78bafc13642a..55b633e451c1 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -57,7 +57,7 @@ static void dummy_comp_handler(void *ctx, struct ibv_wc *= wc) static inline void complete_work(enum ibv_wc_status status, uint32_t vendo= r_err, void *ctx) { - struct ibv_wc wc =3D {0}; + struct ibv_wc wc =3D {}; =20 wc.status =3D status; wc.vendor_err =3D vendor_err; @@ -273,7 +273,7 @@ static void stop_backend_thread(RdmaBackendThread *thre= ad) =20 static void start_comp_thread(RdmaBackendDev *backend_dev) { - char thread_name[THR_NAME_LEN] =3D {0}; + char thread_name[THR_NAME_LEN] =3D {}; =20 stop_backend_thread(&backend_dev->comp_thread); =20 @@ -483,7 +483,7 @@ void rdma_backend_post_send(RdmaBackendDev *backend_dev, struct ibv_sge new_sge[MAX_SGE]; uint32_t bctx_id; int rc; - struct ibv_send_wr wr =3D {0}, *bad_wr; + struct ibv_send_wr wr =3D {}, *bad_wr; =20 if (!qp->ibqp) { /* This field is not initialized for QP0 and QP1 */ if (qp_type =3D=3D IBV_QPT_SMI) { @@ -600,7 +600,7 @@ void rdma_backend_post_recv(RdmaBackendDev *backend_dev, struct ibv_sge new_sge[MAX_SGE]; uint32_t bctx_id; int rc; - struct ibv_recv_wr wr =3D {0}, *bad_wr; + struct ibv_recv_wr wr =3D {}, *bad_wr; =20 if (!qp->ibqp) { /* This field does not get initialized for QP0 and QP= 1 */ if (qp_type =3D=3D IBV_QPT_SMI) { @@ -737,7 +737,7 @@ int rdma_backend_create_qp(RdmaBackendQP *qp, uint8_t q= p_type, uint32_t max_recv_wr, uint32_t max_send_sge, uint32_t max_recv_sge) { - struct ibv_qp_init_attr attr =3D {0}; + struct ibv_qp_init_attr attr =3D {}; =20 qp->ibqp =3D 0; =20 @@ -782,7 +782,7 @@ int rdma_backend_create_qp(RdmaBackendQP *qp, uint8_t q= p_type, int rdma_backend_qp_state_init(RdmaBackendDev *backend_dev, RdmaBackendQP = *qp, uint8_t qp_type, uint32_t qkey) { - struct ibv_qp_attr attr =3D {0}; + struct ibv_qp_attr attr =3D {}; int rc, attr_mask; =20 attr_mask =3D IBV_QP_STATE | IBV_QP_PKEY_INDEX | IBV_QP_PORT; @@ -821,7 +821,7 @@ int rdma_backend_qp_state_rtr(RdmaBackendDev *backend_d= ev, RdmaBackendQP *qp, union ibv_gid *dgid, uint32_t dqpn, uint32_t rq_psn, uint32_t qkey, bool use_qke= y) { - struct ibv_qp_attr attr =3D {0}; + struct ibv_qp_attr attr =3D {}; union ibv_gid ibv_gid =3D { .global.interface_id =3D dgid->global.interface_id, .global.subnet_prefix =3D dgid->global.subnet_prefix @@ -880,7 +880,7 @@ int rdma_backend_qp_state_rtr(RdmaBackendDev *backend_d= ev, RdmaBackendQP *qp, int rdma_backend_qp_state_rts(RdmaBackendQP *qp, uint8_t qp_type, uint32_t sq_psn, uint32_t qkey, bool use_qke= y) { - struct ibv_qp_attr attr =3D {0}; + struct ibv_qp_attr attr =3D {}; int rc, attr_mask; =20 attr.qp_state =3D IBV_QPS_RTS; @@ -1012,7 +1012,7 @@ static void process_incoming_mad_req(RdmaBackendDev *= backend_dev, complete_work(IBV_WC_GENERAL_ERR, VENDOR_ERR_INV_MAD_BUFF, bctx->up_ctx); } else { - struct ibv_wc wc =3D {0}; + struct ibv_wc wc =3D {}; memset(mad, 0, bctx->sge.length); build_mad_hdr((struct ibv_grh *)mad, (union ibv_gid *)&msg->umad.hdr.addr.gid, &msg->hdr.= sgid, diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c index 21a55e225a61..a0f2b13a2438 100644 --- a/hw/rdma/vmw/pvrdma_cmd.c +++ b/hw/rdma/vmw/pvrdma_cmd.c @@ -123,7 +123,7 @@ static int query_port(PVRDMADev *dev, union pvrdma_cmd_= req *req, { struct pvrdma_cmd_query_port *cmd =3D &req->query_port; struct pvrdma_cmd_query_port_resp *resp =3D &rsp->query_port_resp; - struct pvrdma_port_attr attrs =3D {0}; + struct pvrdma_port_attr attrs =3D {}; =20 if (cmd->port_num > MAX_PORTS) { return -EINVAL; diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c index 508d8fca3c9b..5b9786efbe4b 100644 --- a/hw/rdma/vmw/pvrdma_qp_ops.c +++ b/hw/rdma/vmw/pvrdma_qp_ops.c @@ -114,7 +114,7 @@ static void pvrdma_qp_ops_comp_handler(void *ctx, struc= t ibv_wc *wc) =20 static void complete_with_error(uint32_t vendor_err, void *ctx) { - struct ibv_wc wc =3D {0}; + struct ibv_wc wc =3D {}; =20 wc.status =3D IBV_WC_GENERAL_ERR; wc.vendor_err =3D vendor_err; --=20 2.20.1