From patchwork Mon Sep 11 15:13:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Olivier Matz X-Patchwork-Id: 28588 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 E0EF21B1A7; Mon, 11 Sep 2017 17:13:57 +0200 (CEST) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id D17E6199B0 for ; Mon, 11 Sep 2017 17:13:51 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id A2D20CF329 for ; Mon, 11 Sep 2017 17:09:57 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org Date: Mon, 11 Sep 2017 17:13:24 +0200 Message-Id: <20170911151333.5727-2-olivier.matz@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170911151333.5727-1-olivier.matz@6wind.com> References: <20170911151333.5727-1-olivier.matz@6wind.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 01/10] net/bnxt: fix compilation with -Og 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" The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following error: CC rte_pmd_bnxt.o rte_pmd_bnxt.c: In function ‘rte_pmd_bnxt_set_all_queues_drop_en’: rte_pmd_bnxt.c:116:6: error: ‘rc’ may be used uninitialized in this function [-Werror=maybe-uninitialized] int rc; ^~ This can happen if both bp->nr_vnics and bp->pf.active_vfs are 0. Fix it by initializing rc to -EINVAL. Fixes: 49947a13ba9e ("net/bnxt: support Tx loopback, set VF MAC and queues drop") Signed-off-by: Olivier Matz --- drivers/net/bnxt/rte_pmd_bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index c343d9033..484a1cb63 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -113,7 +113,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on) struct rte_eth_dev *eth_dev; struct bnxt *bp; uint32_t i; - int rc; + int rc = -EINVAL; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);