[PATCH] sandbox: p2sb: Silence compiler warning

Simon Glass sjg at chromium.org
Sat Feb 8 15:53:10 CET 2020


Some compilers produce a warning about 'child' being used before init.
Silence this by setting to NULL at the start.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 drivers/misc/p2sb_emul.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/p2sb_emul.c b/drivers/misc/p2sb_emul.c
index c3795c59c0..6c71092f18 100644
--- a/drivers/misc/p2sb_emul.c
+++ b/drivers/misc/p2sb_emul.c
@@ -214,7 +214,7 @@ static int sandbox_p2sb_emul_map_physmem(struct udevice *dev,
 					 void **ptrp)
 {
 	struct p2sb_emul_priv *priv = dev_get_priv(dev);
-	struct udevice *child;
+	struct udevice *child = NULL;  /* Silence compiler warning */
 	unsigned int offset;
 	int barnum;
 	int ret;
-- 
2.25.0.341.g760bfbb309-goog



More information about the U-Boot mailing list