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 4BE9FA2EFC for ; Tue, 17 Sep 2019 09:58:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A9A801BFE0; Tue, 17 Sep 2019 09:58:12 +0200 (CEST) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by dpdk.org (Postfix) with ESMTP id 6F7371BFB2 for ; Tue, 17 Sep 2019 09:58:01 +0200 (CEST) Received: by mail-lj1-f172.google.com with SMTP id e17so2403408ljf.13 for ; Tue, 17 Sep 2019 00:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kQk2dVSxgEy44X1W2wjApuAHZ8jkkzFi1X1SEO9TUGA=; b=fvtrBJtPDcuDwx08iwbItv6+pJAR1qWrGYwmItYNWt6JDFhKMCCf/H0R7IQoehx0FB 5kwJZuY7obx4TZhI5fGcwBqwJCJwnl0P/3qaUfH8gwzhaCLX2u1VvZDyQnukdCteczMc fHbu8pQjLpahtepEfzVqrmv7kR9FGBunskuG6y1SOuognsrm4g2O0YqkqlNIXDMcwOAn IZP9ibIQUXr2R66ILDFqvHB+qg8Vu9e7C13xQUNeqGjGTtEL6DHgStTZqP8FTOrL2xPX B9CQbh591ZiecR55KJu/XCcWEnJRpyAjtRmhmvD3KK1UnzskLh5F1mZzSOYNehjlVNJL EQiQ== 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; bh=kQk2dVSxgEy44X1W2wjApuAHZ8jkkzFi1X1SEO9TUGA=; b=rTRqSiUkHDtDZogiOIVWISFyJhnE+YODQDzZQ8BdTjbBdWXQR99yJ01w2NA1mGVdMw qCAZOUnTvLRXUuUkVBvSNLDPAN3j7COhzF6juWsjgF8nWTjHICKC8Oje1SK0jSoxFd8d Mcy5WTMGre7DKRYFGjeNvpvub3WhJNjOuSIDFIid3cacAlji3kIpnliKLXq52liqUFA0 bwCizPc0P2FULVGviZAYTl/KmolprKZYncYTWljixlEKAEKYZf9XOsCIY9XS4Ya6wni0 1B7e/NCgpthFMI0oUMbuEaWB9iDr8yScnA7oT7VnbmLx8ftfnOPX6oolDuE8h4X8x7wL VekQ== X-Gm-Message-State: APjAAAUazHWikWgTmhoVmzo1ckk3AO5ObsNXj6dg7rmz5QjUnBun53X8 pogg8/bBqjG+KOhPa4H+oJCGhsWjxBUUHw== X-Google-Smtp-Source: APXvYqzPq2KF30J6gaWjK8HVZ+vqA9T3ac341e7ejJFmlqeXy6lPAPZjP3FMF1a5Iq9wTGqynO1C3A== X-Received: by 2002:a2e:88d4:: with SMTP id a20mr1048810ljk.201.1568707080915; Tue, 17 Sep 2019 00:58:00 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id g1sm270659ljl.31.2019.09.17.00.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 00:58:00 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org, Yipeng Wang , Sameh Gobriel , Bruce Richardson , Pablo de Lara , Chas Williams , Anatoly Burakov Cc: mattias.ronnblom@ericsson.com, stephen@networkplumber.org, Andrzej Ostruszka Date: Tue, 17 Sep 2019 09:57:49 +0200 Message-Id: <20190917075754.8310-6-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190917075754.8310-1-amo@semihalf.com> References: <20190917075754.8310-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH v2 05/10] app/test: fix maybe-uninitialized warnings for LTO build 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. 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