From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 2CB4FC5BE for ; Thu, 23 Jun 2016 19:06:06 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id a66so58934850wme.0 for ; Thu, 23 Jun 2016 10:06:06 -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=dpXX11WY/446orlPfzk5GAmgSHXjyz6WdvEbn0y9gltb/h3EIl+TcH4T+SvaGFVzua vNvnseTKWDAwE3igwt4ruKswms0UsSp9Hz2DDPSqXo93skIhKtQj3LTaKl2iFwaOWIRR l1oR3853CDkkqmxHXPFBm9l4WPVneSmlDbp508xTScMsBiV55Omtcz2vbeCctZVeQ/DN rS8SefIFMeul9gf53z4lQWU3ibWN5iy0wq0rnuwV21+q0376SXOOVjIWuPIKfpn5+Lzb Itmyn5gxeosOufN151lsi3USnrUYmE564zE82hS0FgWqIob61mnuIzxAYmxWz8HwOOxa 7BqA== 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=T+3zlHKxc1AzCrui/KkY2XiikrM/wsXnkh/tFMp2SDXN41e906Y0xkj/0MNIUnqXO7 SDcXJlqLyxPlQSc6I/sWIM6dMYXKkL/KTC5CBuB5U6U+Li2C1fGx/Xo6GBuuasQ4vi+7 OwZT+lyjWKJLKENTpmb/Xu/+pNhtCfOYfGdYlNgW4wgzsQ010O+HnhGQNhKmJ8DIgnYc rcqAz3wkNX3ILxx4DxCTEKL52AEJQjT93ZMO21cJbJax0JjzmQTvzX+w0sdBwp6lSifC Km7xspFW3GumL3q4UkYSiFKKI4QztS9WBnlKHfoxlgj+HD4lkFSliUdC3NGRPy7KAXnk E9XA== X-Gm-Message-State: ALyK8tJxiRHEPmuCEWfKGFC3r58noKv7MKTd8bvJYymgCUpM2JgXf3kXnAXLIeJV3Xsi6ycK X-Received: by 10.194.168.225 with SMTP id zz1mr19315935wjb.114.1466701566000; Thu, 23 Jun 2016 10:06:06 -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 q63sm4770644wma.0.2016.06.23.10.06.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Jun 2016 10:06:05 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Ferruh Yigit , Adrien Mazarguil Date: Thu, 23 Jun 2016 19:05:20 +0200 Message-Id: <1466700801-10383-11-git-send-email-nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1466700801-10383-1-git-send-email-nelio.laranjeiro@6wind.com> References: <1466586355-30777-1-git-send-email-nelio.laranjeiro@6wind.com> <1466700801-10383-1-git-send-email-nelio.laranjeiro@6wind.com> Subject: [dpdk-dev] [PATCH v5 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: Thu, 23 Jun 2016 17:06:06 -0000 Content-Type: text/plain; charset="UTF-8" Message-ID: <20160623170520.fKsoI_I4pzY3yKUqOwfl0Aw3PxgkB_Ky_Yva4qFV87Q@z> 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