From patchwork Fri Nov 16 16:58:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 48166 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 52BFE4CC5; Fri, 16 Nov 2018 17:59:08 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id D82904CB3; Fri, 16 Nov 2018 17:59:06 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5AE2D21D63; Fri, 16 Nov 2018 11:59:06 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 16 Nov 2018 11:59:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=m5hcfuoiG7 JnTDNuK2vzx8gdJmBgjPQQUYP2zeotaaw=; b=cHCCX/4FQdOdzwmbPCNc5w77SD FfHMapwZGLce9DVDmg/Is5Sn+AMomUJIrtuUXqkU4RtuR86UhfOt64cwzH0KWe+E z0jGQ05Q1N+L8fqshoZWpQAzDRU5wSAf1NcUZpDg0e9fmiOxuuFqnq5bgDDbVPhN cOSs5zGx1fHBgDwec= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=m5hcfuoiG7JnTDNuK2vzx8gdJmBgjPQQUYP2zeotaaw=; b=rDPi12JC DUI2F70CHKCTN1y7QZnWihhWsR7/HHTDU2Y26cyOSef55nD0mg41vWADsmMPgtsp EwNN9lDCMKlzXz2rXWNDB/MWz2O19BZHcCQzsKhBB1kZjEBzrCrz6WVrfKXpCvkq VEz8urh7V7lM5ZjN5Gvu4dblQsNeM+BG8f7imrWmyopAaXxXF/oNmhmGfpttdT1u 7YP1UrKaRJUsR3hs5BrgI3+fGYyniVnaaAQo7jeJSxoUznAvSrh7YxYUl9P0JGIK mBdns6FftT3VtUAtLlxYBGaGz+0KvxB+uqQPs9agi4qUUmgvxX8BC995E0q+6iTW Wx5bAB9Krvw5LQ== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D024102E0; Fri, 16 Nov 2018 11:59:05 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: stable@dpdk.org Date: Fri, 16 Nov 2018 17:58:50 +0100 Message-Id: <20181116165854.24017-2-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181116165854.24017-1-thomas@monjalon.net> References: <20181116165854.24017-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 1/5] eal: fix build with -O1 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" In case of optimized compilation, RTE_BUILD_BUG_ON use an external variable which is neither defined, nor used. It seems not optimized out in case of OPDL compiled with clang -O1: opdl_ring.c: undefined reference to `RTE_BUILD_BUG_ON_detected_error' clang-6.0: fatal error: linker command failed with exit code 1 Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- lib/librte_eal/common/include/rte_common.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 87f0f6302..57acb8485 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -270,16 +270,7 @@ rte_is_aligned(void *ptr, unsigned align) /** * Triggers an error at compilation time if the condition is true. */ -#ifndef __OPTIMIZE__ #define RTE_BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) -#else -extern int RTE_BUILD_BUG_ON_detected_error; -#define RTE_BUILD_BUG_ON(condition) do { \ - ((void)sizeof(char[1 - 2*!!(condition)])); \ - if (condition) \ - RTE_BUILD_BUG_ON_detected_error = 1; \ -} while(0) -#endif /** * Combines 32b inputs most significant set bits into the least From patchwork Fri Nov 16 16:58:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 48167 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 820B75424; Fri, 16 Nov 2018 17:59:11 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 857544D27; Fri, 16 Nov 2018 17:59:08 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1C17621BFD; Fri, 16 Nov 2018 11:59:08 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 16 Nov 2018 11:59:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=vahhRK12dL TbLhe7wohN9l57CmCJG29LBezrXHb5M0Q=; b=II+1I6XweyhtYspVFrpaPwtVq2 kHRtf2eLlbAaIEOroI7zGu0IAApAcEOaRml+X0Hux8v+/vke/m8lI1ejmfhQqyED tiPWmSmC7qfsOw7cxdzEkOEcVvQFowpimLNJzVjicTYhXoruqJTCIURry0efPxPq CcGG54N4Bv2sMF77Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=vahhRK12dLTbLhe7wohN9l57CmCJG29LBezrXHb5M0Q=; b=byvhaTW9 7eMhj1jWZARzhSQt/iWjtgm8cZXzR2bmY3l+LIYNR5KrDfqXNCPNlZGHuxZjT5H0 bJFu1lVSL66yh3yxlbzGHBTzZECgRz/dLppgI5psRQCpgSbRg4ghGTEfie3a3nXR yzWaZf61/uJYqAmU35LqA0mXuzVHsrE2ASA06O3FHBUeK6lK4TxwDp1Q0mo6wN9n ZdfqBPCdb28iy7uMPl1jtU87TAdgC/hA68yA5mAo//gC4COj91+8Twd+t04l1Ytb GbU0FBVUWnfys5ZZYgko02OlIb+mHolfeywSBGCtYRjsFs+GCPYK2T5D8fIDLEao QCr64i/KlOhJYw== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 5EBF2102E8; Fri, 16 Nov 2018 11:59:07 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: stable@dpdk.org Date: Fri, 16 Nov 2018 17:58:51 +0100 Message-Id: <20181116165854.24017-3-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181116165854.24017-1-thomas@monjalon.net> References: <20181116165854.24017-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 2/5] kni: fix possible uninitialized variable 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" This error can be raised: lib/librte_kni/rte_kni.c:531:15: error: 'req' may be used uninitialized in this function It should not happen because kni_fifo_get() would return 0 if req is not initialized, so the function would return before using req. But GCC complains about it in -O1 optimization, and a NULL initialization is harmless here. Fixes: 3fc5ca2f6352 ("kni: initial import") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- lib/librte_kni/rte_kni.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index c9726d4f8..73aeccccf 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -483,7 +483,7 @@ int rte_kni_handle_request(struct rte_kni *kni) { unsigned ret; - struct rte_kni_request *req; + struct rte_kni_request *req = NULL; if (kni == NULL) return -1; From patchwork Fri Nov 16 16:58:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 48168 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5D8325587; Fri, 16 Nov 2018 17:59:13 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id D86004F91; Fri, 16 Nov 2018 17:59:09 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 7FB0121F26; Fri, 16 Nov 2018 11:59:09 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 16 Nov 2018 11:59:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=WlvX5/g9DuTsnQbZ88LXQK0oigcF130TvHS6R4Phh4c=; b=dqOCq67TZ7x8 z+njzCbU48U0DJIGmY9dT7mq4c5BV82b3q9TqLJ8dvvCILSL351YllCcEZfOh8Lj gjj39AUXs5VZ6XdsN99iOR0x10G5RESlGoWpH8/k96yUWnyiGlwMMRsbH/6C0dmk v5w1T7Qbd6IAQ3HPgveBHGaV8UVNAJU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=WlvX5/g9DuTsnQbZ88LXQK0oigcF130TvHS6R4Phh 4c=; b=ISDwu1rYL9eo0gUGPytSU8RgpxY8XRzRLI+FxIkaUuV0Hyuj6F9EM3ZPJ VlRuPyaVVJgQn1FNHgYzJhhlx8l9kxzma490AsSZ6Vjxf3gqjT2GBO4PlwlpKJk0 RnZDQ6RKa8SapoWIHDfVZYr16vHd/zVt9wsmUZGL8p4aZfKPmAClz1OhPUQ1yMb2 9eeNb05Wj8qH6NG6qowsuuYEs4p+GbpRRuR+LIx06VnGjMyLum4t9/C50PepfdeP TVsul5o09RWKNXU7oUsn1ndQefTvEGT2NbGPAYILma4dT6QxpOsD5K52hM2krsfm N/JAZAyZ/5rY6OPI4+eOUkhAqfrfg== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id CB8D6102DD; Fri, 16 Nov 2018 11:59:08 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: stable@dpdk.org Date: Fri, 16 Nov 2018 17:58:52 +0100 Message-Id: <20181116165854.24017-4-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181116165854.24017-1-thomas@monjalon.net> References: <20181116165854.24017-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 3/5] net/mlx4: fix possible uninitialized variable 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 compiling with gcc -O1, this error appears: drivers/net/mlx4/mlx4_ethdev.c: In function ‘mlx4_rxmode_toggle’: rte_log.h:321:3: error: ‘mode’ may be used uninitialized in this function The function mlx4_rxmode_toggle is never called with a value which is not in the switch block, but GCC complains about it with -O1. So the default case is "fixed" by setting string "undefined". Fixes: eacaac7bae36 ("net/mlx4: restore promisc and allmulti support") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- drivers/net/mlx4/mlx4_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c index 30deb3ef0..195a1b6df 100644 --- a/drivers/net/mlx4/mlx4_ethdev.c +++ b/drivers/net/mlx4/mlx4_ethdev.c @@ -360,6 +360,8 @@ mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum rxmode_toggle toggle) mode = "all multicast"; dev->data->all_multicast = toggle & 1; break; + default: + mode = "undefined"; } if (!mlx4_flow_sync(priv, &error)) return; From patchwork Fri Nov 16 16:58:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 48169 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C0BB258C6; Fri, 16 Nov 2018 17:59:15 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 628BC4F9B for ; Fri, 16 Nov 2018 17:59:11 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 11FB421F26; Fri, 16 Nov 2018 11:59:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 16 Nov 2018 11:59:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=MMaMq1fONtcmx5V+yJSJYvegHuJGflbFGFoIInYej0U=; b=oQUM7EhxRLYX DRq03N9VLGuJJJQcSgqoFizqI6mdMf02Kn4gDCj0DiCcRsyUWwQzVeM22AQ9rKW0 LbK/dG+TlJAZ5CHk51zInB0VRxXwPz1xJ91lpuAmhRQskHWieG0qLV0C4U7P9REa fExB9k7JCuqQDI+3a3YfmE2/Du2E4H4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=MMaMq1fONtcmx5V+yJSJYvegHuJGflbFGFoIInYej 0U=; b=AYjzhJ2raCp3LEjQlKTYGBptNhwtxYdcZ9nc6taeulSdgMpbblT6ep21V 8mMQXsYPo3wBRAmekLXzhKSA2UyPykVowC7kBVk6k0AeEHLFToSpn+hs2yyHbEHZ HHYwQwwtvZ8w57jAEwaREVGKXgWVhiZKb/aj93aW281N0rlfClcIhS8qd4ygplK6 GdyC99gKZs89e05t79TsMD19l/pBcfYKgnW5GAN6T62HwuxkUFiiZrBfJX2PZsRu ojRIeKl3DCym9tGOq8HuI8Yl14wxn9loygGNFti2HambzZgcZUJJQyZZ9lUAjrHt snFMlb0gD6v3RkQhVGIJ4APgE2tMg== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 431EC102EE; Fri, 16 Nov 2018 11:59:10 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: nikhil.rao@intel.com Date: Fri, 16 Nov 2018 17:58:53 +0100 Message-Id: <20181116165854.24017-5-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181116165854.24017-1-thomas@monjalon.net> References: <20181116165854.24017-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 4/5] eventdev: fix possible uninitialized variable 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 compiling with -O1, this error can appear: lib/librte_eventdev/rte_event_eth_tx_adapter.c:705:6: error: ‘ret’ may be used uninitialized in this function If tx_queue_id is -1 and nb_queues is 0, then ret is returned without being initialized. It is fixed by setting 0 as initial value. Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation") Cc: nikhil.rao@intel.com Signed-off-by: Thomas Monjalon --- lib/librte_eventdev/rte_event_eth_tx_adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.c b/lib/librte_eventdev/rte_event_eth_tx_adapter.c index 3a21defba..ccf8a7550 100644 --- a/lib/librte_eventdev/rte_event_eth_tx_adapter.c +++ b/lib/librte_eventdev/rte_event_eth_tx_adapter.c @@ -702,7 +702,7 @@ txa_service_queue_add(uint8_t id, struct txa_service_queue_info *tqi; struct rte_eth_dev_tx_buffer *tb; struct txa_retry *txa_retry; - int ret; + int ret = 0; txa = txa_service_id_to_data(id); From patchwork Fri Nov 16 16:58:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 48170 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 59B0558FA; Fri, 16 Nov 2018 17:59:19 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 0C6B356A3 for ; Fri, 16 Nov 2018 17:59:18 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id AF03421FAE; Fri, 16 Nov 2018 11:59:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 16 Nov 2018 11:59:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=1jCV04WpCgs12GcClNZQyIT/H6pSpxiDBnDYhpD5sb8=; b=K9eyM3OW4NGm RmQZCPhvgpWq1eZf5PNf4pBOpYW23UGbKWe4NRGd+8o5FCX17vrjjutjYK2cmyWp YdxYZz81eRMMLvUynk2R8zstqDejK8Nq4E3kK+vWYE13oeLaNChWWLZamGM/q4zT RBxB+3siVaIblFFxyRgf+q6e03LAH2A= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=1jCV04WpCgs12GcClNZQyIT/H6pSpxiDBnDYhpD5s b8=; b=wN2NP5+o9U6ySOydZ9RRzvdvj94V2OesriFtTRGrQ+uS9K5+04Fx8jlPP e2jAXsPFZTuuC2XzAGlWzUs9ZbkBBpRpMvFYCYB0HEZt5DMLW6WWNlThu8i6iBef Jq0KQ5ygW5ypuj87Y49hqa1PPm0c+vfb6WHRywfoFMTEICScDnh5UhCmLC6FLxT3 XrrRU0F6EKPBWRjZ0vByYsna2PHy4MPooFrwWj7xXqg3qX0HhxXeIIA2sD5ghJZW SH3tYAs4uroSLWvXb71dle39oEDYAckVPtsmdSGVv/EBzJix8RUO6mII7jRDPfVB RCF0pFtZIHxVul8y2+OFadumpX03A== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 84684102E0; Fri, 16 Nov 2018 11:59:16 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: pbhagavatula@caviumnetworks.com Date: Fri, 16 Nov 2018 17:58:54 +0100 Message-Id: <20181116165854.24017-6-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181116165854.24017-1-thomas@monjalon.net> References: <20181116165854.24017-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 5/5] app/eventdev: fix possible uninitialized variable 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 compiling with -O1, this error can appear: app/test-eventdev/test_pipeline_common.c:332:6: error: ‘ret’ may be used uninitialized in this function If there is no device, then ret is returned without being initialized. It is fixed by setting 0 as initial value. Fixes: 032a965a8f1d ("app/eventdev: support Tx adapter") Cc: pbhagavatula@caviumnetworks.com Signed-off-by: Thomas Monjalon --- app/test-eventdev/test_pipeline_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index d07fa8826..5db3ffde1 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -329,7 +329,7 @@ int pipeline_event_tx_adapter_setup(struct evt_options *opt, struct rte_event_port_conf port_conf) { - int ret; + int ret = 0; uint16_t consm; RTE_ETH_FOREACH_DEV(consm) {