From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7C632A328D for ; Tue, 22 Oct 2019 13:55:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3FFD41BEF0; Tue, 22 Oct 2019 13:54:33 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 3598B1BEE3 for ; Tue, 22 Oct 2019 13:54:30 +0200 (CEST) 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 x9MBeUOs014357; Tue, 22 Oct 2019 04:54:28 -0700 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=zUC9hTqMxCcFUGosYMDTyS1xGS9DIRRdY1DIS1wI0p8=; b=aEAZNQsK7uymWgW2jT3X5XhIM51ioASY9i3BaLHyotx+48YJIj4EJ1sHvFrZq+XH+WWQ RJZ7Vxlqj3RwQ7TKhIerRRINigRzujj8I9K6Yl9McB4rKEMfUinnXLLcbacjxbzGRJGm Y3tXSgLyqwxKFLMA+igE4sneloDYNIpkpZzP0O9a33WltppEYSa4JtR801xRo3ruj7AY /u8RW/1IqYzW0GxtU+QZx2BEnUHdisqy4bzcqvMRfjOGtHnX0shj4P3ewKbWx8w1Dc3q dVUq3m8TPZ9X7kCakXkAO8icqcP//mEyPZtZKcWgCIomg6C+anjK45hRh0Ii8Ufsfy/W mw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2vsyjh8acg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 04:54:28 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 04:54:27 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 04:54:27 -0700 Received: from amok.marvell.com (unknown [10.95.130.40]) by maili.marvell.com (Postfix) with ESMTP id CC6473F703F; Tue, 22 Oct 2019 04:54:24 -0700 (PDT) From: Andrzej Ostruszka To: , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Pablo de Lara , Chas Williams , Anatoly Burakov CC: , Date: Tue, 22 Oct 2019 13:54:07 +0200 Message-ID: <20191022115412.8837-6-aostruszka@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191022115412.8837-1-aostruszka@marvell.com> References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: [dpdk-dev] [PATCH v4 05/10] app/test: 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: ‘stats.greatest_free_size’ may be used uninitialized in this function [-Werror=maybe-uninitialized] return len - overhead; Signed-off-by: Andrzej Ostruszka --- app/test/test_hash_readwrite.c | 2 +- app/test/test_link_bonding_mode4.c | 10 ++++++++-- app/test/test_memzone.c | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/test/test_hash_readwrite.c b/app/test/test_hash_readwrite.c index 4376b099b..615767fb6 100644 --- a/app/test/test_hash_readwrite.c +++ b/app/test/test_hash_readwrite.c @@ -298,7 +298,7 @@ test_rw_reader(void *arg) begin = rte_rdtsc_precise(); for (i = 0; i < read_cnt; i++) { - void *data; + void *data = arg; rte_hash_lookup_data(tbl_rw_test_param.h, tbl_rw_test_param.keys + i, &data); diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c index bbb4e9cce..5f7df1b5e 100644 --- a/app/test/test_link_bonding_mode4.c +++ b/app/test/test_link_bonding_mode4.c @@ -224,7 +224,7 @@ configure_ethdev(uint16_t port_id, uint8_t start) static int add_slave(struct slave_conf *slave, uint8_t start) { - struct rte_ether_addr addr, addr_check; + struct rte_ether_addr addr, addr_check = { { 0 } }; /* Some sanity check */ RTE_VERIFY(test_params.slave_ports <= slave && @@ -578,7 +578,13 @@ bond_get_update_timeout_ms(void) { struct rte_eth_bond_8023ad_conf conf; - rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf); + if (rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf) < 0) { + RTE_LOG(DEBUG, EAL, "Failed to get bonding configuration: " + "%s at %d\n", __func__, __LINE__); + RTE_TEST_TRACE_FAILURE(__FILE__, __LINE__, __func__); + return 0; + } + return conf.update_timeout_ms; } diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c index 7501b63c5..c284dcb44 100644 --- a/app/test/test_memzone.c +++ b/app/test/test_memzone.c @@ -476,7 +476,8 @@ find_max_block_free_size(unsigned int align, unsigned int socket_id) struct rte_malloc_socket_stats stats; size_t len, overhead; - rte_malloc_get_socket_stats(socket_id, &stats); + if (rte_malloc_get_socket_stats(socket_id, &stats) < 0) + return 0; len = stats.greatest_free_size; overhead = MALLOC_ELEM_OVERHEAD; -- 2.17.1