From patchwork Mon Mar 19 17:26:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 147595 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 37045B6FCB for ; Tue, 20 Mar 2012 04:26:26 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2BF8528071; Mon, 19 Mar 2012 18:26:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dj1W25a9DNyQ; Mon, 19 Mar 2012 18:26:21 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CF4AD28077; Mon, 19 Mar 2012 18:26:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3B9FE28077 for ; Mon, 19 Mar 2012 18:26:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IIBn+fZ2xACq for ; Mon, 19 Mar 2012 18:26:14 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-gx0-f172.google.com (mail-gx0-f172.google.com [209.85.161.172]) by theia.denx.de (Postfix) with ESMTPS id 43FC728071 for ; Mon, 19 Mar 2012 18:26:12 +0100 (CET) Received: by ggmi1 with SMTP id i1so5515632ggm.3 for ; Mon, 19 Mar 2012 10:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:organization :user-agent; bh=t5dJXhkARaDlyzMTnauk5Y86uUZSgE9p3VBHD7GgpgQ=; b=Dh+4fcIco0bI+rvDqJoFkGWnLXejIgp5gcvw5IfONfHN0oILMZU/I9gWGKo9hEZv3A EOiJnIjBT6AMWAj7Q6bVPm2cTtCjgX1z/JvjvwCrtMLvQ1UAU+1QtbgsbEkyB8Hu6DaG BeDCLHbqjC11c83i+v/vn/1pwQnPxmUR9zA0cPd6g+bYvT0pfRJn2y50tPkaLK5z1N7f PhfZw17HVXX/dn64g+5Q4YQascVLLNz6tDQBwNk1uTu9+iezqAlHI1rxjYWm8a1R+yc2 q9nimnWX/weJakYzZAqoruvLsITJ/O1rBguCsbe9DSb7SolnJuLr56TCS0Q28qPNukFP wfmw== Received: by 10.68.221.106 with SMTP id qd10mr26889958pbc.161.1332177969690; Mon, 19 Mar 2012 10:26:09 -0700 (PDT) Received: from bill-the-cat (ip68-230-54-74.ph.ph.cox.net. [68.230.54.74]) by mx.google.com with ESMTPS id p10sm11758719pbo.55.2012.03.19.10.26.07 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Mar 2012 10:26:08 -0700 (PDT) Date: Mon, 19 Mar 2012 10:26:05 -0700 From: Tom Rini To: Stefano Babic Message-ID: <20120319172605.GC19810@bill-the-cat> 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1331820106-17103-13-git-send-email-sbabic@denx.de> Organization: Texas Instruments User-Agent: Mutt/1.5.20 (2009-06-14) Cc: u-boot@lists.denx.de, Simon Schwarz Subject: Re: [U-Boot] [PATCH V14 12/13] arm: Add Prep subcommand support to bootm X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@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: The original code used simple_strtoul which doesn't cause a warning here and newer gcc decided the unpatched usage was fine. 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)" \