From patchwork Thu Jun 9 08:49:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rahul Lakkireddy X-Patchwork-Id: 112606 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C8211A0558; Thu, 9 Jun 2022 10:50:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BAEA4427F6; Thu, 9 Jun 2022 10:50:48 +0200 (CEST) Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by mails.dpdk.org (Postfix) with ESMTP id 0EC9740220 for ; Thu, 9 Jun 2022 10:50:46 +0200 (CEST) Received: from localhost (sicon-nithya-lt.asicdesigners.com [10.193.177.166] (may be forged)) by stargate.chelsio.com (8.14.7/8.14.7) with ESMTP id 2598oig6015269; Thu, 9 Jun 2022 01:50:45 -0700 From: Rahul Lakkireddy To: dev@dpdk.org Cc: daxuex.gao@intel.com Subject: [PATCH] net/cxgbe: fix warnings when using optimization=1 flag Date: Thu, 9 Jun 2022 14:19:40 +0530 Message-Id: <155c777425bc32c4d287373cd711825f8de9bcf2.1654764457.git.rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Initialize maddr and mtype to fix following warnings when using optimization=1 compilation flag. In file included from ../drivers/net/cxgbe/base/common.h:13, from ../drivers/net/cxgbe/cxgbe_main.c:37: ../drivers/net/cxgbe/cxgbe_main.c: In function ‘cxgbe_probe’: ../drivers/net/cxgbe/base/t4fw_interface.h:656:7: warning: ‘maddr’ may be used uninitialized in this function [-Wmaybe-uninitialized] ((x) << S_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF) ^~ ../drivers/net/cxgbe/cxgbe_main.c:1111:40: note: ‘maddr’ was declared here u32 finiver, finicsum, cfcsum, mtype, maddr, param, val; ^~~~~ In file included from ../drivers/net/cxgbe/base/common.h:13, from ../drivers/net/cxgbe/cxgbe_main.c:37: ../drivers/net/cxgbe/base/t4fw_interface.h:648:7: warning: ‘mtype’ may be used uninitialized in this function [-Wmaybe-uninitialized] ((x) << S_FW_CAPS_CONFIG_CMD_MEMTYPE_CF) ^~ ../drivers/net/cxgbe/cxgbe_main.c:1111:33: note: ‘mtype’ was declared here u32 finiver, finicsum, cfcsum, mtype, maddr, param, val; ^~~~~ Bugzilla ID: 1029 Fixes: 6d7d651bbc15 ("net/cxgbe: read firmware configuration file from filesystem") Reported-by: Daxue Gao Signed-off-by: Rahul Lakkireddy --- drivers/net/cxgbe/cxgbe_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c index 7b162af3e7..3c02c98b3d 100644 --- a/drivers/net/cxgbe/cxgbe_main.c +++ b/drivers/net/cxgbe/cxgbe_main.c @@ -1108,9 +1108,10 @@ static int cxgbe_load_fw_config_from_filesystem(struct adapter *adap, static int cxgbe_load_fw_config(struct adapter *adap) { - u32 finiver, finicsum, cfcsum, mtype, maddr, param, val; struct fw_caps_config_cmd caps_cmd = { 0 }; + u32 finiver, finicsum, cfcsum, param, val; const char *config_name = NULL; + u32 mtype = 0, maddr = 0; int ret; ret = cxgbe_load_fw_config_from_filesystem(adap, &config_name,