From patchwork Tue Jun 21 07:23:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?N=C3=A9lio_Laranjeiro?= X-Patchwork-Id: 14134 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 44C42ADC2; Tue, 21 Jun 2016 09:25:14 +0200 (CEST) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by dpdk.org (Postfix) with ESMTP id 8CE61ADF9 for ; Tue, 21 Jun 2016 09:24:22 +0200 (CEST) Received: by mail-lf0-f52.google.com with SMTP id l188so9654184lfe.2 for ; Tue, 21 Jun 2016 00:24:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=smDvbUq7s6MRLgbeSq0Gjw1N6usO5oW8V0z90PqqMYY=; b=YkJKz5ZXEc+FicM3naBlqgiyMkEelVfv2TdCZ9WUh2YD1vhE1nri0xdBaQY17LdRTw x2eGElKuXS20Wh5gwLKaaL0+sAUXBA4odtwgIIxkOgAAjj5CoT78mNLd0gD6y4Xo5fKB Yv4AD4qXAxP2ecRmF4YtO3FA6gN/90ijddC8dWw20oA81qx9MCerTIbUDToZnQ+tNA0L izX6IymBHhRR4dD4QJ7BrDkRWwE7JD2ya4qIgiQ01AperoET4izPfQxd7MSwTb6H9pgQ 13Mz+3RuX35eopgJVVtaKFqopnSGGBagWR05GhGuemnmMKXxqb08nZkmV6cvzBmj/IMH u5XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=smDvbUq7s6MRLgbeSq0Gjw1N6usO5oW8V0z90PqqMYY=; b=T6sNq3jA2IJLYGdAW9umMnAEwIsQxxm0C+lUVVbKQ2MjEC/JVubNc+mwPOmqaUe+nu fxON/8VxuDoO9+T85IZ6pEHIBogJccDcAvFGZCPkULv2J0g5FZCm25sjyxPg5dTKlwSM YE8CirnuNss3KeOfdnBThLA48eXTkxqL5p7fW/yugWSyJBau0LWZmVzJBvok7AjduYKX fkgd2zcZdX/2Yc6GNPrRi6veA7/wGx9LjLQ4ZpeCbtiXltP0hDcu+5ul8afXQhY6zdO3 UiVDaANwC+R/7DS/Nj78JFsoTnaVd9otXhjXFyvl97NBFILnxX+2fByivc/rdSz5l4gj 9DGg== X-Gm-Message-State: ALyK8tLx0mZ+SeQnX4j7x68TH1fNABZEyFJi86SfmyP68kAHcnK8Me+hPrRJ3jJ3otE7mJml X-Received: by 10.25.30.133 with SMTP id e127mr1348290lfe.202.1466493862223; Tue, 21 Jun 2016 00:24:22 -0700 (PDT) Received: from ping.vm.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id mh10sm6527314lbb.14.2016.06.21.00.24.21 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Jun 2016 00:24:21 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Ferruh Yigit , Adrien Mazarguil Date: Tue, 21 Jun 2016 09:23:35 +0200 Message-Id: <1466493818-1877-23-git-send-email-nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1466493818-1877-1-git-send-email-nelio.laranjeiro@6wind.com> References: <1465379291-25310-1-git-send-email-nelio.laranjeiro@6wind.com> <1466493818-1877-1-git-send-email-nelio.laranjeiro@6wind.com> In-Reply-To: <1465379291-25310-1-git-send-email-nelio.laranjeiro@6wind.com> References: <1465379291-25310-1-git-send-email-nelio.laranjeiro@6wind.com> Subject: [dpdk-dev] [PATCH v3 22/25] mlx5: work around spurious compilation errors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Adrien Mazarguil Since commit "mlx5: resurrect Tx gather support", older GCC versions (such as 4.8.5) may complain about the following: mlx5_rxtx.c: In function `mlx5_tx_burst': mlx5_rxtx.c:705:25: error: `wqe' may be used uninitialized in this function [-Werror=maybe-uninitialized] mlx5_rxtx.c: In function `mlx5_tx_burst_inline': mlx5_rxtx.c:864:25: error: `wqe' may be used uninitialized in this function [-Werror=maybe-uninitialized] In both cases, this code cannot be reached when wqe is not initialized. Considering older GCC versions are still widely used, work around this issue by initializing wqe preemptively, even if it should not be necessary. Signed-off-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5_rxtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index db784c0..2fc57dc 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -591,7 +591,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) unsigned int j = 0; unsigned int max; unsigned int comp; - volatile union mlx5_wqe *wqe; + volatile union mlx5_wqe *wqe = NULL; if (unlikely(!pkts_n)) return 0; @@ -733,7 +733,7 @@ mlx5_tx_burst_inline(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) unsigned int j = 0; unsigned int max; unsigned int comp; - volatile union mlx5_wqe *wqe; + volatile union mlx5_wqe *wqe = NULL; unsigned int max_inline = txq->max_inline; if (unlikely(!pkts_n))