Skip to contentSkip to conversation

tegra20: initialize variable to avoid compiler warning

PATCH New Allen Martin 3 participants 3 messages Oct 20, 2012 – Oct 26, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tegra20: initialize variable to avoid compiler warning

Initialize this variable to avoid a compiler warning about possible use of uninitialized variable with gcc 4.4.6.

---
 arch/arm/cpu/tegra20-common/emc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/tegra20-common/emc.c +1 -1
index 97420d7..90edf00 100644
@@ -257,7 +257,7 @@ static int decode_emc(const void *blob, unsigned rate, struct emc_ctlr **emcp,
 int tegra_set_emc(const void *blob, unsigned rate)
 {
 	struct emc_ctlr *emc;
-	const u32 *table;
+	const u32 *table = NULL;
 	int err, i;
 
 	err = decode_emc(blob, rate, &emc, &table);
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 tegra20: initialize variable to avoid compiler warning

Quoted 2 lines · Allen Martin

Initialize this variable to avoid a compiler warning about possible use of uninitialized variable with gcc 4.4.6.

#2 lore raw

PATCH 1/1 tegra20: initialize variable to avoid compiler warning

In reply to Allen Martin

Hi,

Quoted 4 lines · Allen Martin

Initialize this variable to avoid a compiler warning about possible use of uninitialized variable with gcc 4.4.6.

I suppose the compiler is confused by the 'return node' bit. It might be better to set '*emcp = NULL' at the top of decode_emc(), but this is fine too.

Quoted 24 lines
---
 arch/arm/cpu/tegra20-common/emc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/tegra20-common/emc.c +1 -2
index 97420d7..90edf00 100644
@@ -257,7 +257,7 @@ static int decode_emc(const void *blob, unsigned rate, struct emc_ctlr **emcp,
 int tegra_set_emc(const void *blob, unsigned rate)
 {
        struct emc_ctlr *emc;
-       const u32 *table;
+       const u32 *table = NULL;
        int err, i;
 
        err = decode_emc(blob, rate, &emc, &table);
--

1.7.10.4

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot