[PATCH 04/10] globalvar: Fix compiler warning

Sascha Hauer s.hauer at pengutronix.de
Wed Nov 23 01:39:31 PST 2016


Fixes:
common/globalvar.c:393:7: warning: 'pname' may be used uninitialized in this function [-Wmaybe-uninitialized]

This is a false positive, pname cannot be uninitialized. Silence this
warning.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/globalvar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/globalvar.c b/common/globalvar.c
index 85d0795..52808f8 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -382,7 +382,7 @@ void globalvar_set_match(const char *match, const char *val)
 static int globalvar_simple_set(struct device_d *dev, struct param_d *p, const char *val)
 {
 	struct device_d *rdev;
-	const char *pname;
+	const char *pname = NULL;
 	int ret;
 
 	ret = nvvar_device_dispatch(p->name, &rdev, &pname);
-- 
2.10.2




More information about the barebox mailing list