From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B2F0DA04DD; Thu, 19 Nov 2020 16:00:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E9B3C3B5; Thu, 19 Nov 2020 16:00:19 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C09D023D; Thu, 19 Nov 2020 16:00:17 +0100 (CET) IronPort-SDR: lr6BlCKoIn2oAsIeL1kMEo/Bc3xQobmtQKM4+L6M45uVBV9aoFKW5WeUkJtTHB3lhXwdkSRAzL MnS70JbRS+oQ== X-IronPort-AV: E=McAfee;i="6000,8403,9809"; a="189386615" X-IronPort-AV: E=Sophos;i="5.77,490,1596524400"; d="scan'208";a="189386615" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2020 07:00:15 -0800 IronPort-SDR: CWqznLGXZtzcmtE8g7Etg/tLsO9VkmGaiSVDVe2HnDVIkdE/tfaDkAPQNWVEllelM8ZDV7cWfD d11SsDLYTcWw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,490,1596524400"; d="scan'208";a="401533478" Received: from silpixa00400466.ir.intel.com ([10.237.213.98]) by orsmga001.jf.intel.com with ESMTP; 19 Nov 2020 07:00:13 -0800 From: Conor Walsh To: rosen.xu@intel.com, tianfei.zhang@intel.com, andy.pei@intel.com Cc: dev@dpdk.org, stable@dpdk.org, linglix.chen@intel.com, Conor Walsh Date: Thu, 19 Nov 2020 15:00:11 +0000 Message-Id: <20201119150011.4005300-1-conor.walsh@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] raw/ifpga/base: fix uninitialized variables gcc warning 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" On Ubuntu 18.04 using gcc 7.5, gcc sees size and start as possibly being uninitialized. This patch initialises size and start to correct this warning. Exact warning: ../drivers/raw/ifpga/base/opae_intel_max10.c:488:22: warning: ‘size’ may be used uninitialized in this function [-Wmaybe-uninitialized] raw->regs[i].size = size; ../drivers/raw/ifpga/base/opae_intel_max10.c:484:25: warning: ‘start’ may be used uninitialized in this function [-Wmaybe-uninitialized] raw->regs[i].regoff = start; Fixes: 45f301724ba7 ("raw/ifpga/base: support sensor") Signed-off-by: Conor Walsh --- drivers/raw/ifpga/base/opae_intel_max10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/raw/ifpga/base/opae_intel_max10.c b/drivers/raw/ifpga/base/opae_intel_max10.c index 1a526ea549..1c12a85195 100644 --- a/drivers/raw/ifpga/base/opae_intel_max10.c +++ b/drivers/raw/ifpga/base/opae_intel_max10.c @@ -418,7 +418,7 @@ max10_sensor_init(struct intel_max10_device *dev, int parent) int i, ret = 0, offset = 0; const fdt32_t *num; const char *ptr; - u64 start, size; + u64 start = 0, size = 0; struct raw_sensor_info *raw; struct opae_sensor_info *sensor; char *fdt_root = dev->fdt_root; -- 2.25.1