patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Conor Walsh <conor.walsh@intel.com>
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 <conor.walsh@intel.com>
Subject: [dpdk-stable] [PATCH] raw/ifpga/base: fix uninitialized variables gcc warning
Date: Thu, 19 Nov 2020 15:00:11 +0000	[thread overview]
Message-ID: <20201119150011.4005300-1-conor.walsh@intel.com> (raw)

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 <conor.walsh@intel.com>
---
 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


             reply	other threads:[~2020-11-19 15:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 15:00 Conor Walsh [this message]
2020-11-20  1:22 ` Xu, Rosen
2020-11-23 17:18   ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
2020-11-20  7:28 ` [dpdk-stable] " Chen, LingliX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201119150011.4005300-1-conor.walsh@intel.com \
    --to=conor.walsh@intel.com \
    --cc=andy.pei@intel.com \
    --cc=dev@dpdk.org \
    --cc=linglix.chen@intel.com \
    --cc=rosen.xu@intel.com \
    --cc=stable@dpdk.org \
    --cc=tianfei.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).