From: Tom Rini Date: Mon, 19 Mar 2012 10:26:05 -0700 Subject: [U-Boot] [PATCH V14 12/13] arm: Add Prep subcommand support to bootm In-Reply-To: <1331820106-17103-13-git-send-email-sbabic@denx.de> References: <1328350963-30989-1-git-send-email-sbabic@denx.de> <1331820106-17103-1-git-send-email-sbabic@denx.de> <1331820106-17103-13-git-send-email-sbabic@denx.de> Message-ID: <20120319172605.GC19810@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Mar 15, 2012 at 03:01:45PM +0100, Stefano Babic wrote: > From: Simon Schwarz > > 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. -- Tom