From 5f566f454750be4f2f83288ef382afcb9c4aa8a4 Mon Sep 17 00:00:00 2001
From: Wolfgang Denk <wd@denx.de>
Date: Sun, 31 Jan 2010 21:51:43 +0100
Subject: [PATCH] cmd_ximg.c: fix error: 'i' undeclared

Fix compile error:

	cmd_ximg.c: In function 'do_imgextract':
	cmd_ximg.c:234: error: 'i' undeclared (first use in this function)
	cmd_ximg.c:234: error: (Each undeclared identifier is reported only once
	cmd_ximg.c:234: error: for each function it appears in.)

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 common/cmd_ximg.c | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/common/cmd_ximg.c b/common/cmd_ximg.c
index 3e5fb44475..b34c4d02da 100644
--- a/common/cmd_ximg.c
+++ b/common/cmd_ximg.c
@@ -225,20 +225,25 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 			break;
 #if defined(CONFIG_BZIP2)
 		case IH_COMP_BZIP2:
-			printf ("   Uncompressing part %d ... ", part);
-			/*
-			 * If we've got less than 4 MB of malloc() space,
-			 * use slower decompression algorithm which requires
-			 * at most 2300 KB of memory.
-			 */
-			i = BZ2_bzBuffToBuffDecompress
-				((char*)ntohl(hdr->ih_load),
-				 &unc_len, (char *)data, len,
-				 CONFIG_SYS_MALLOC_LEN < (4096 * 1024), 0);
-			if (i != BZ_OK) {
-				printf ("BUNZIP2 ERROR %d - "
-					"image not loaded\n", i);
-				return 1;
+			{
+				int i;
+
+				printf ("   Uncompressing part %d ... ", part);
+				/*
+                                 * If we've got less than 4 MB of malloc()
+				 * space, use slower decompression algorithm
+				 * which requires at most 2300 KB of memory.
+				 */
+				i = BZ2_bzBuffToBuffDecompress(
+					(char*)ntohl(hdr->ih_load),
+					&unc_len, (char *)data, len,
+					CONFIG_SYS_MALLOC_LEN < (4096 * 1024),
+					0);
+				if (i != BZ_OK) {
+					printf ("BUNZIP2 ERROR %d - "
+						"image not loaded\n", i);
+					return 1;
+				}
 			}
 			break;
 #endif /* CONFIG_BZIP2 */
-- 
2.39.5