
On Thu, Mar 15, 2012 at 03:01:45PM +0100, Stefano Babic wrote:
From: Simon Schwarz simonschwarzcor@googlemail.com
Adds prep subcommand to bootm implementation of ARM. When bootm is called with the subcommand prep the function stops right after ATAGS creation and before announce_and_cleanup.
This is used in command "cmd_spl export"
[snip]
+static void boot_jump_linux(bootm_headers_t *images) +{
- int machid = gd->bd->bi_arch_number;
[snip]
- if (s) {
strict_strtoul(s, 16, (long unsigned int *) &machid);
printf("Using machid 0x%x from environment\n", machid);
- }
This upsets gcc 4.2. bi_arch_number is an unsigned long so I'm applying the following to this patch as part of my commit:
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 03c25e9..fc73ca9 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -310,7 +310,7 @@ static void boot_prep_linux(bootm_headers_t *images) /* Subcommand: GO */ static void boot_jump_linux(bootm_headers_t *images) { - int machid = gd->bd->bi_arch_number; + unsigned long machid = gd->bd->bi_arch_number; char *s; void (*kernel_entry)(int zero, int arch, uint params);
@@ -318,8 +318,8 @@ static void boot_jump_linux(bootm_headers_t *images)
s = getenv("machid"); if (s) { - strict_strtoul(s, 16, (long unsigned int *) &machid); - printf("Using machid 0x%x from environment\n", machid); + strict_strtoul(s, 16, &machid); + printf("Using machid 0x%lx from environment\n", machid); }
debug("## Transferring control to Linux (at address %08lx)" \
The original code used simple_strtoul which doesn't cause a warning here and newer gcc decided the unpatched usage was fine.