public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Matthew McClintock <msm@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Fix possible uninitialized variable	compiler warning.
Date: Wed, 11 Oct 2006 16:02:28 -0500	[thread overview]
Message-ID: <1160600548.5466.45.camel@localhost> (raw)
In-Reply-To: <528646bc0610092323k748bfc45v13f53affd381e1a9@mail.gmail.com>

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 <grant.likely@secretlab.ca>
> ---
>  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

  parent reply	other threads:[~2006-10-11 21:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-10  6:23 [U-Boot-Users] [PATCH] Fix possible uninitialized variable compiler warning Grant Likely
2006-10-10  7:05 ` Wolfgang Denk
2006-10-10  7:13   ` Grant Likely
2006-10-10  8:58     ` Wolfgang Denk
2006-10-11  6:09       ` Grant Likely
2006-10-11  7:44         ` Wolfgang Denk
2006-10-11 15:30           ` Grant Likely
2006-10-11 17:14             ` Haavard Skinnemoen
2006-10-11 20:10             ` Wolfgang Denk
2006-10-12 19:08               ` Grant Likely
2006-10-12 20:26                 ` Wolfgang Denk
2006-10-12 20:51                   ` Grant Likely
2006-10-13  0:13                     ` Wolfgang Denk
2006-10-11 18:22       ` Matthew McClintock
2006-10-11 18:29         ` Grant Likely
2006-10-11 20:34         ` Wolfgang Denk
2006-10-11 21:02 ` Matthew McClintock [this message]
2006-10-11 21:55   ` Wolfgang Denk
2006-10-11 22:04   ` Wolfgang Denk
2006-10-12  6:27     ` Matthew McClintock
2006-10-12  9:16       ` Markus Klotzbücher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1160600548.5466.45.camel@localhost \
    --to=msm@freescale.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox