From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew McClintock Date: Wed, 11 Oct 2006 16:02:28 -0500 Subject: [U-Boot-Users] [PATCH] Fix possible uninitialized variable compiler warning. In-Reply-To: <528646bc0610092323k748bfc45v13f53affd381e1a9@mail.gmail.com> References: <528646bc0610092323k748bfc45v13f53affd381e1a9@mail.gmail.com> Message-ID: <1160600548.5466.45.camel@localhost> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 2006-10-10 at 00:23 -0600, Grant Likely wrote: > This patch applies against the u-boot tree at > git://www.jdl.com/software/u-boot-86xx.git > > When CONFIG_OF_FLAG_TREE is set, the compiler complains that 'len' in > do_bootm_linux() may be uninitialized. There is no possibility in the > current code that len will get used uninitialized, but this fix follows > the existing convention of setting both len and data to zero at the same > time. > > Signed-off-by: Grant Likely > --- > common/cmd_bootm.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c > index 652d843..af949a3 100644 > --- a/common/cmd_bootm.c > +++ b/common/cmd_bootm.c > @@ -623,7 +623,7 @@ #ifdef CONFIG_OF_FLAT_TREE > /* Look for a '-' which indicates to ignore the ramdisk argument */ > if (argc >= 3 && strcmp(argv[2], "-") == 0) { > debug ("Skipping initrd\n"); > - data = 0; > + len = data = 0; > } > else > #endif I just checked in a patch which fixes a lot of compiler warnings including this one. Again, the tree lives at: http://opensource.freescale.com/pub/scm/u-boot-85xx.git Thanks Grant. -Matthew