[new uImage] Cleanup image header pointer use in bootm code
- use single image header pointer instead of a set of auxilliary variables.
- add multi component image helper routines: get component size/data address
Signed-off-by: Marian Balakowicz <m8@semihalf.com>
diff --git a/common/cmd_autoscript.c b/common/cmd_autoscript.c
index 3e68ced..53f8e83 100644
--- a/common/cmd_autoscript.c
+++ b/common/cmd_autoscript.c
@@ -54,7 +54,7 @@
{
ulong len;
image_header_t *hdr = (image_header_t *)addr;
- ulong *len_ptr;
+ ulong *data;
char *cmd;
int rcode = 0;
int verify;
@@ -84,9 +84,9 @@
}
/* get length of script */
- len_ptr = (ulong *)image_get_data (hdr);
+ data = (ulong *)image_get_data (hdr);
- if ((len = image_to_cpu (*len_ptr)) == 0) {
+ if ((len = image_to_cpu (*data)) == 0) {
puts ("Empty Script\n");
return 1;
}
@@ -97,10 +97,10 @@
return 1;
}
- while (*len_ptr++);
+ while (*data++);
/* make sure cmd is null terminated */
- memmove (cmd, (char *)len_ptr, len);
+ memmove (cmd, (char *)data, len);
*(cmd + len) = 0;
#ifdef CFG_HUSH_PARSER /*?? */