From patchwork Thu Nov 7 15:03:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Andrzej Ostruszka [C]" X-Patchwork-Id: 62673 X-Patchwork-Delegate: thomas@monjalon.net 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 BFE55A034E; Thu, 7 Nov 2019 16:05:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F76C1BFA0; Thu, 7 Nov 2019 16:03:49 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id F227C1BF91 for ; Thu, 7 Nov 2019 16:03:46 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xA7EskbI023769; Thu, 7 Nov 2019 07:03:46 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=3MSB39sY0jvBs9Jk+rsFl6QE6Dr6vrO6NuZEJihQ4UY=; b=EK1PPAcc8s0OCX7OfDQ4zpErxlwVnMJ7mIQQnhYcQeoi9PNX2M4MaX+LBhZrzgn5GEg4 9wWH3+U8zq+34ek1b9z1qTsoK/2Wu1IiuSAJU6Zyq2hW43VwWrnfGTrEDVoMzo7E6Dq+ Uzji02EJ7qAHsaxAwFRu7PyzY8oM7MXi3kCqpJWd0gEmgC9/6ipMbVbTkBzUhdTs+Bvo 8dCJNOFjxEH4n8L220tkOeXmcv1MNggi/AgzgIgrePF2mOiU/Gx9RSG8LpWXpZmCTBHE MX09hG1CcqDzV7KNLqhr/5LEYcNXJOvaVjRSCLQ7igALh8c0OJAt+XAwwaJWxesLlHOP Iw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2w41uwvrgn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 07 Nov 2019 07:03:46 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 7 Nov 2019 07:03:45 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 7 Nov 2019 07:03:45 -0800 Received: from amok.marvell.com (unknown [10.95.130.48]) by maili.marvell.com (Postfix) with ESMTP id DB30B3F7041; Thu, 7 Nov 2019 07:03:43 -0800 (PST) From: Andrzej Ostruszka To: , Xiao Wang CC: , Date: Thu, 7 Nov 2019 16:03:17 +0100 Message-ID: <20191107150318.3677-12-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191107150318.3677-1-aostruszka@marvell.com> References: <20191029141212.4907-1-aostruszka@marvell.com> <20191107150318.3677-1-aostruszka@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-07_05:2019-11-07,2019-11-07 signatures=0 Subject: [dpdk-dev] [PATCH v7 11/12] net/ifc: clean LTO build warnings (maybe-uninitialized) 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" During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Exemplary compiler warning to suppress (with LTO enabled): error: ‘features’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (RTE_VHOST_NEED_LOG(features)) { Signed-off-by: Andrzej Ostruszka --- drivers/net/ifc/ifcvf_vdpa.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c index 8de9ef199..9c562def0 100644 --- a/drivers/net/ifc/ifcvf_vdpa.c +++ b/drivers/net/ifc/ifcvf_vdpa.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -304,8 +305,8 @@ vdpa_ifcvf_stop(struct ifcvf_internal *internal) struct ifcvf_hw *hw = &internal->hw; uint32_t i; int vid; - uint64_t features; - uint64_t log_base, log_size; + uint64_t features = 0; + uint64_t log_base = 0, log_size = 0; uint64_t len; vid = internal->vid; @@ -348,6 +349,8 @@ vdpa_enable_vfio_intr(struct ifcvf_internal *internal, bool m_rx) struct rte_vhost_vring vring; int fd; + vring.callfd = -1; + nr_vring = rte_vhost_get_vring_num(internal->vid); irq_set = (struct vfio_irq_set *)irq_set_buf; @@ -442,6 +445,7 @@ notify_relay(void *arg) } internal->epfd = epfd; + vring.kickfd = -1; for (qid = 0; qid < q_num; qid++) { ev.events = EPOLLIN | EPOLLPRI; rte_vhost_get_vhost_vring(internal->vid, qid, &vring); @@ -583,6 +587,7 @@ m_ifcvf_start(struct ifcvf_internal *internal) uint64_t size; uint64_t gpa; + memset(&vq, 0, sizeof(vq)); vid = internal->vid; nr_vring = rte_vhost_get_vring_num(vid); rte_vhost_get_negotiated_features(vid, &hw->req_features); @@ -721,6 +726,7 @@ vring_relay(void *arg) } internal->epfd = epfd; + vring.kickfd = -1; for (qid = 0; qid < q_num; qid++) { ev.events = EPOLLIN | EPOLLPRI; rte_vhost_get_vhost_vring(vid, qid, &vring); @@ -930,11 +936,11 @@ ifcvf_dev_close(int vid) static int ifcvf_set_features(int vid) { - uint64_t features; + uint64_t features = 0; int did; struct internal_list *list; struct ifcvf_internal *internal; - uint64_t log_base, log_size; + uint64_t log_base = 0, log_size = 0; did = rte_vhost_get_vdpa_device_id(vid); list = find_internal_resource_by_did(did);