From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3499BA0032; Wed, 16 Mar 2022 08:29:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2EB0410EC; Wed, 16 Mar 2022 08:29:56 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id EC04140395; Wed, 16 Mar 2022 08:29:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647415795; x=1678951795; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=9eSlbdF7PG7Rtk06e/ZEqynY9eTLLNOuYCeK7ws8lCo=; b=UBWoaeiR7E6wxUvDAzoPAFXwlpoEoAP9T77+89TJz96nzcEXvYg7lxve 7pE6os647Nq9oFTwjU7soPMHgY078Z9ts/xzp4xGDzK4pM+ASZYiaump8 L/aFc03e79xhV+EgeC2b5GlI3jkagMEk3NR6SbvXSiw1FKjFYtYWOPejN BV9BSBBKWTz3kt1NdN0XBtwmcNQUJt63CJBraCp4i4PHBTlKgMSGFhz65 H/byLgq7HFWlg3QoHB9Mo6xJsR/Kr8KOBtTmIXlZhiITTHYLPNxMrzj/H 4HSQzwSs+IItqxZv256rdn17h6YKPHCP30oyQLCW8PE7OpEcQWu2hYCyR g==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="281292008" X-IronPort-AV: E=Sophos;i="5.90,186,1643702400"; d="scan'208";a="281292008" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2022 00:29:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,186,1643702400"; d="scan'208";a="714489519" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.238.175.107]) by orsmga005.jf.intel.com with ESMTP; 16 Mar 2022 00:29:50 -0700 From: Wei Huang To: dev@dpdk.org, thomas@monjalon.net, rosen.xu@intel.com, nipun.gupta@nxp.com, hemant.agrawal@nxp.com Cc: stable@dpdk.org, tianfei.zhang@intel.com, qi.z.zhang@intel.com, ferruh.yigit@intel.com, Wei Huang Subject: [PATCH v1] raw/ifpga: initialize variable to avoid compile error Date: Wed, 16 Mar 2022 03:26:30 -0400 Message-Id: <20220316072630.1916479-1-wei.huang@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Compile failed with cflag optimization=1 on Ubuntu20.04 with GCC10.3, it reported vendor_id and dev_id may be used uninitialized in function ifpga_rawdev_fill_info(). Actually it's not the truth, the variables are initialized in function ifpga_get_dev_vendor_id(). To avoid such compile error, the variables are initialized when they are defined. Signed-off-by: Wei Huang Acked-by: Tianfei Zhang Acked-by: Rosen Xu --- drivers/raw/ifpga/ifpga_rawdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c index 26c1366..6d4117c 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.c +++ b/drivers/raw/ifpga/ifpga_rawdev.c @@ -225,7 +225,8 @@ static int ifpga_rawdev_fill_info(struct ifpga_rawdev *ifpga_dev) unsigned int dom, bus, dev; int func; - uint32_t dev_id, vendor_id; + uint32_t dev_id = 0; + uint32_t vendor_id = 0; adapter = ifpga_dev ? ifpga_rawdev_get_priv(ifpga_dev->rawdev) : NULL; if (!adapter) -- 1.8.3.1