From patchwork Wed Nov 4 17:02:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Walsh X-Patchwork-Id: 83690 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 32F7FA04B1; Wed, 4 Nov 2020 18:03:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F34172BFF; Wed, 4 Nov 2020 18:03:04 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id D35412BF5 for ; Wed, 4 Nov 2020 18:03:02 +0100 (CET) IronPort-SDR: u/GUu95xZYYt5l96mDGdWdIAAaqwrlLpjRmp9QKc+IqCZxNSvN0BFCVZMSvyXqSGpu0KW68pag orZl0yrIJAVA== X-IronPort-AV: E=McAfee;i="6000,8403,9795"; a="149100187" X-IronPort-AV: E=Sophos;i="5.77,451,1596524400"; d="scan'208";a="149100187" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2020 09:02:11 -0800 IronPort-SDR: 3F+hXNDWFh4b6ajprnNbc2nnA84XvckPGM9Ho+9VNvFflpeYp9KgOezfUOq9LVqEO9dUeOCZ5o UwB1ng9PsiYA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,451,1596524400"; d="scan'208";a="325686197" Received: from silpixa00400466.ir.intel.com ([10.237.213.98]) by orsmga006.jf.intel.com with ESMTP; 04 Nov 2020 09:02:10 -0800 From: Conor Walsh To: maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: dev@dpdk.org, linglix.chen@intel.com, Conor Walsh Date: Wed, 4 Nov 2020 17:02:05 +0000 Message-Id: <20201104170205.1688705-1-conor.walsh@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v1] vhost: slot_idx needs to be initialised to fix gcc compile error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When DPDK is compiled with gcc < 9 with the optimization level set to 1 gcc sees slot_idx as possibly being uninitialised. To correct this error slot_idx has been initialised to 0. Signed-off-by: Conor Walsh --- lib/librte_vhost/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 3a019b7446..bef39180b5 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -1491,7 +1491,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev, struct iovec *dst_iovec = vec_pool + (VHOST_MAX_ASYNC_VEC >> 1); struct rte_vhost_iov_iter *src_it = it_pool; struct rte_vhost_iov_iter *dst_it = it_pool + 1; - uint16_t n_free_slot, slot_idx; + uint16_t n_free_slot, slot_idx = 0; uint16_t pkt_err = 0; uint16_t segs_await = 0; struct async_inflight_info *pkts_info = vq->async_pkts_info;