* [U-Boot] [PATCH] tegra20: initialize variable to avoid compiler warning
@ 2012-10-20 7:18 Allen Martin
2012-10-22 17:07 ` Stephen Warren
2012-10-26 16:38 ` Simon Glass
0 siblings, 2 replies; 3+ messages in thread
From: Allen Martin @ 2012-10-20 7:18 UTC (permalink / raw)
To: u-boot
Initialize this variable to avoid a compiler warning about possible
use of uninitialized variable with gcc 4.4.6.
Signed-off-by: Allen Martin <amartin@nvidia.com>
---
arch/arm/cpu/tegra20-common/emc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/cpu/tegra20-common/emc.c b/arch/arm/cpu/tegra20-common/emc.c
index 97420d7..90edf00 100644
--- a/arch/arm/cpu/tegra20-common/emc.c
+++ b/arch/arm/cpu/tegra20-common/emc.c
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] tegra20: initialize variable to avoid compiler warning
2012-10-20 7:18 [U-Boot] [PATCH] tegra20: initialize variable to avoid compiler warning Allen Martin
@ 2012-10-22 17:07 ` Stephen Warren
2012-10-26 16:38 ` Simon Glass
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2012-10-22 17:07 UTC (permalink / raw)
To: u-boot
On 10/20/2012 01:18 AM, Allen Martin wrote:
> Initialize this variable to avoid a compiler warning about possible
> use of uninitialized variable with gcc 4.4.6.
Acked-by: Stephen Warren <swarren@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] tegra20: initialize variable to avoid compiler warning
2012-10-20 7:18 [U-Boot] [PATCH] tegra20: initialize variable to avoid compiler warning Allen Martin
2012-10-22 17:07 ` Stephen Warren
@ 2012-10-26 16:38 ` Simon Glass
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2012-10-26 16:38 UTC (permalink / raw)
To: u-boot
Hi,
On Sat, Oct 20, 2012 at 12:18 AM, Allen Martin <amartin@nvidia.com> wrote:
> Initialize this variable to avoid a compiler warning about possible
> use of uninitialized variable with gcc 4.4.6.
>
> Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
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.
> ---
> arch/arm/cpu/tegra20-common/emc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/cpu/tegra20-common/emc.c b/arch/arm/cpu/tegra20-common/emc.c
> index 97420d7..90edf00 100644
> --- a/arch/arm/cpu/tegra20-common/emc.c
> +++ b/arch/arm/cpu/tegra20-common/emc.c
> @@ -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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-26 16:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-20 7:18 [U-Boot] [PATCH] tegra20: initialize variable to avoid compiler warning Allen Martin
2012-10-22 17:07 ` Stephen Warren
2012-10-26 16:38 ` Simon Glass
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.