DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] raw/ifpga/base: fix uninitialized variables gcc warning
@ 2020-11-19 15:00 Conor Walsh
  2020-11-20  1:22 ` Xu, Rosen
  2020-11-20  7:28 ` Chen, LingliX
  0 siblings, 2 replies; 4+ messages in thread
From: Conor Walsh @ 2020-11-19 15:00 UTC (permalink / raw)
  To: rosen.xu, tianfei.zhang, andy.pei; +Cc: dev, stable, linglix.chen, Conor Walsh

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-23 17:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 15:00 [dpdk-dev] [PATCH] raw/ifpga/base: fix uninitialized variables gcc warning Conor Walsh
2020-11-20  1:22 ` Xu, Rosen
2020-11-23 17:18   ` Ferruh Yigit
2020-11-20  7:28 ` Chen, LingliX

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).