From patchwork Thu Mar 14 15:30:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 1056589 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="a4+Ja/om"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44KtFQ4Kppz9s3q for ; Fri, 15 Mar 2019 02:40:10 +1100 (AEDT) Received: from localhost ([127.0.0.1]:39759 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4SSm-0003k9-Er for incoming@patchwork.ozlabs.org; Thu, 14 Mar 2019 11:40:08 -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) 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) 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) 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 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;