From patchwork Wed Mar 13 08:46:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10850795 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B9811669 for ; Wed, 13 Mar 2019 09:00:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 832FB28C1D for ; Wed, 13 Mar 2019 09:00:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7056E299E1; Wed, 13 Mar 2019 09:00:12 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E0D7528C1D for ; Wed, 13 Mar 2019 09:00:11 +0000 (UTC) Received: from localhost ([127.0.0.1]:40703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3zkB-00072u-6j for patchwork-qemu-devel@patchwork.kernel.org; Wed, 13 Mar 2019 05:00:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3zg4-0003Kb-S5 for qemu-devel@nongnu.org; Wed, 13 Mar 2019 04:55:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3zY8-0005VY-G9 for qemu-devel@nongnu.org; Wed, 13 Mar 2019 04:47:45 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:52566) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3zY6-0005T9-HU for qemu-devel@nongnu.org; Wed, 13 Mar 2019 04:47:42 -0400 Received: by mail-wm1-x344.google.com with SMTP id f65so979085wma.2 for ; Wed, 13 Mar 2019 01:47:41 -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=Az/vZonZ5pN2ZVBStLxXLovnbZP/gBft2ZYLS9IkX9c=; b=blloXn1j41VkVhaS/NvflyVhfY2FNR2W9wCnkDz6ijcDjLC+i4FdC+u4Ou5pnCSW3B fhFHoXgyqiqUkLV4tCBckxg2cGnmc4k1ZAhdpVaLXg+13hYwX8p3CRJJwP1N/xtp2crR 3oqhAY5oekmRMETgfSKMc41vGUkSxReNTiP2QbHNMVjzm8IRJcxmqD3q56SdDxNWR4yc kKleKZmUZXYzQnWViNkumT8INbSSoF3uMUgkqbmlysf6M5aAuHSC41ViXDQzrV/nQVE4 V+ZcR8NY37FbD/l7tGiljBtY/ivg6ULsqThAzkXq4lU14qZjsKS0/VdD8/9q5N+iK1MJ SrxQ== 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=Az/vZonZ5pN2ZVBStLxXLovnbZP/gBft2ZYLS9IkX9c=; b=LcQ2JwgHhzG3vh835dmRs8uqtp1x7gMOi0RYtuE/FeLqchNYbTns06wZVqXNPXdJCT xXbBNmk0dmli2TQfPzvnVOcRsdFsbpLPoLKsfNTV3uxfoi+HZdus5E0315+QiZanF0fK m9tDgHQItYLkAC8ZrxrCEvDFxm/g/IDma5ktwb2vDNE0EftguZo0M7hFYXOMRBL00TZF HH7m1t13DbqZgUJUEW9hZ9uqh0Sh6NfykSebJGUm27Qic/kABg1DAFUCKMGMFIULVWtj Kp/vKaTZ1L8Q2cL2DTu4bwq131vl5nKwYoCaLwrYgjgZz4MyktBHI5U3Kshz0p1kQjY/ 5szg== X-Gm-Message-State: APjAAAXMWpDPIrfOBCVskWlqID6RwaRXepETwUhdmizZ2ruJ4JjvyOVS zTifwuZhD2sFibT2hLYmBZ19Gvri X-Google-Smtp-Source: APXvYqxtlISRf+zybZ5+VWq4R3wJsuuOYZo/WpzCDNmZM7FV946gx8oZ2r4us0Z4fBSpjOYU3m1QQw== X-Received: by 2002:a1c:eb17:: with SMTP id j23mr1326845wmh.86.1552466859800; Wed, 13 Mar 2019 01:47:39 -0700 (PDT) Received: from kheib-workstation.redhat.com ([192.116.94.220]) by smtp.gmail.com with ESMTPSA id o18sm37683587wrg.40.2019.03.13.01.47.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Mar 2019 01:47:39 -0700 (PDT) From: Kamal Heib To: qemu-devel@nongnu.org Date: Wed, 13 Mar 2019 10:46:47 +0200 Message-Id: <20190313084648.9513-4-kamalheib1@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190313084648.9513-1-kamalheib1@gmail.com> References: <20190313084648.9513-1-kamalheib1@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Kamal Heib Reviewed-by: Marcel Apfelbaum --- 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 vendor_err, void *ctx) { - struct ibv_wc wc = {0}; + struct ibv_wc wc = {}; wc.status = status; wc.vendor_err = vendor_err; @@ -273,7 +273,7 @@ static void stop_backend_thread(RdmaBackendThread *thread) static void start_comp_thread(RdmaBackendDev *backend_dev) { - char thread_name[THR_NAME_LEN] = {0}; + char thread_name[THR_NAME_LEN] = {}; stop_backend_thread(&backend_dev->comp_thread); @@ -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 = {0}, *bad_wr; + struct ibv_send_wr wr = {}, *bad_wr; if (!qp->ibqp) { /* This field is not initialized for QP0 and QP1 */ if (qp_type == 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 = {0}, *bad_wr; + struct ibv_recv_wr wr = {}, *bad_wr; if (!qp->ibqp) { /* This field does not get initialized for QP0 and QP1 */ if (qp_type == IBV_QPT_SMI) { @@ -737,7 +737,7 @@ int rdma_backend_create_qp(RdmaBackendQP *qp, uint8_t qp_type, uint32_t max_recv_wr, uint32_t max_send_sge, uint32_t max_recv_sge) { - struct ibv_qp_init_attr attr = {0}; + struct ibv_qp_init_attr attr = {}; qp->ibqp = 0; @@ -782,7 +782,7 @@ int rdma_backend_create_qp(RdmaBackendQP *qp, uint8_t qp_type, int rdma_backend_qp_state_init(RdmaBackendDev *backend_dev, RdmaBackendQP *qp, uint8_t qp_type, uint32_t qkey) { - struct ibv_qp_attr attr = {0}; + struct ibv_qp_attr attr = {}; int rc, attr_mask; attr_mask = IBV_QP_STATE | IBV_QP_PKEY_INDEX | IBV_QP_PORT; @@ -821,7 +821,7 @@ int rdma_backend_qp_state_rtr(RdmaBackendDev *backend_dev, RdmaBackendQP *qp, union ibv_gid *dgid, uint32_t dqpn, uint32_t rq_psn, uint32_t qkey, bool use_qkey) { - struct ibv_qp_attr attr = {0}; + struct ibv_qp_attr attr = {}; union ibv_gid ibv_gid = { .global.interface_id = dgid->global.interface_id, .global.subnet_prefix = dgid->global.subnet_prefix @@ -880,7 +880,7 @@ int rdma_backend_qp_state_rtr(RdmaBackendDev *backend_dev, RdmaBackendQP *qp, int rdma_backend_qp_state_rts(RdmaBackendQP *qp, uint8_t qp_type, uint32_t sq_psn, uint32_t qkey, bool use_qkey) { - struct ibv_qp_attr attr = {0}; + struct ibv_qp_attr attr = {}; int rc, attr_mask; attr.qp_state = 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 = {0}; + struct ibv_wc wc = {}; 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 = &req->query_port; struct pvrdma_cmd_query_port_resp *resp = &rsp->query_port_resp; - struct pvrdma_port_attr attrs = {0}; + struct pvrdma_port_attr attrs = {}; 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, struct ibv_wc *wc) static void complete_with_error(uint32_t vendor_err, void *ctx) { - struct ibv_wc wc = {0}; + struct ibv_wc wc = {}; wc.status = IBV_WC_GENERAL_ERR; wc.vendor_err = vendor_err;