From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 0DEC2C75C for ; Fri, 24 Jun 2016 15:19:23 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id a66so25276586wme.0 for ; Fri, 24 Jun 2016 06:19:23 -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; bh=ADsvkSchWD9K7hVhrNLAS62RLEF11RWRDrGcaCuqGCc=; b=pW2CNGYzcVqQey9GJzEzcJFc6ZGrBTIFd3hjWGSPmWUp230mrsGPdmb9zkIF2A282o GA1BDDF7E9z3NnjeLdrgl+GI3jDWYLo82Jk5DOtfDZ3Y6Njc5Q+bZEQ75nBUkyguKnmo +cdD3E+DTAfsoCW8uVMbp7EdbP9FsWpUbGUABYHODY5EW5LUBfLomjEJjnC2cQ7/QADP eIJZW44XVoRy7mcBgXT6NOwth3nOulByReG6VkUvm1+TqlATAe+pWEy7EQ5Y1nOZ222r buTP0CJuJ9qLTccvyz+YobRoD9r9TiXxHGV7GRvkFCvTV+FYE/aYRG/vzlbCYTtZ0OFF S6rg== 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; bh=ADsvkSchWD9K7hVhrNLAS62RLEF11RWRDrGcaCuqGCc=; b=CJ44z31rRxyDrhagRrF9tcJG4Rivm/f2SiSL7optN1Jz+wslqlcXtLjU70SmYF5a/w HYicvvoptTC2R28+bqKPp7SiiX05KSiVEHX6KckTcaV4KTUPO+Ls7om9oQRMJgHbTYt6 ByDzz9F85Yw6NMuhR7WsVRiULMUNUsGJjbghqVg4R4EvA37ZWPd4/GYHo+ibUcxLczey z7xxasXD7PlGO29sBysQl+Va9Qaj95j94vg/z/a2HvdSfOcC7IvkP/sgc8PzHNQJmFHo BWO1qJMXvHTvqQgStbgVmedi8TFxizuGEi6J+7+J/FuhFanN19sFU/i+mWyd18z7vQFd HP8w== X-Gm-Message-State: ALyK8tLew14GNs5TfmdjSHTUUwqes+PB0MkAIvaJRXYxHiJ29N5QwrfyCOiUDp8a+mdzJpto X-Received: by 10.194.101.41 with SMTP id fd9mr3793009wjb.27.1466774362825; Fri, 24 Jun 2016 06:19: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 m125sm1279533wmm.8.2016.06.24.06.19.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Jun 2016 06:19:22 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Bruce Richardson , Ferruh Yigit , Adrien Mazarguil Date: Fri, 24 Jun 2016 15:18:01 +0200 Message-Id: <1466774284-20932-23-git-send-email-nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1466774284-20932-1-git-send-email-nelio.laranjeiro@6wind.com> References: <1466758261-25986-1-git-send-email-nelio.laranjeiro@6wind.com> <1466774284-20932-1-git-send-email-nelio.laranjeiro@6wind.com> Subject: [dpdk-dev] [PATCH v7 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: , X-List-Received-Date: Fri, 24 Jun 2016 13:19:23 -0000 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 c72e7ce..8b67949 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -593,7 +593,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; @@ -741,7 +741,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)) -- 2.1.4