From patchwork Fri Apr 12 07:53:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingkai Hu X-Patchwork-Id: 235990 X-Patchwork-Delegate: afleming@freescale.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 4529A2C00AD for ; Fri, 12 Apr 2013 18:47:49 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A93564A01B; Fri, 12 Apr 2013 10:47:46 +0200 (CEST) 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 CR-GYMX-VO9t; Fri, 12 Apr 2013 10:47:46 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 046314A01E; Fri, 12 Apr 2013 10:47:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B50CE4A01E for ; Fri, 12 Apr 2013 10:47:42 +0200 (CEST) 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 qmpz-uYO2Jjt for ; Fri, 12 Apr 2013 10:47:41 +0200 (CEST) X-Greylist: delayed 907 seconds by postgrey-1.27 at theia; Fri, 12 Apr 2013 10:47:39 CEST 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 co1outboundpool.messaging.microsoft.com (co1ehsobe002.messaging.microsoft.com [216.32.180.185]) by theia.denx.de (Postfix) with ESMTPS id 2F3BA4A01B for ; Fri, 12 Apr 2013 10:47:39 +0200 (CEST) Received: from mail108-co1-R.bigfish.com (10.243.78.238) by CO1EHSOBE026.bigfish.com (10.243.66.89) with Microsoft SMTP Server id 14.1.225.23; Fri, 12 Apr 2013 08:32:29 +0000 Received: from mail108-co1 (localhost [127.0.0.1]) by mail108-co1-R.bigfish.com (Postfix) with ESMTP id 5B975200054 for ; Fri, 12 Apr 2013 08:32:29 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1fc6h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ahzz8275bhz2dh2a8h668h839he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h16a6h1758h1898h18e1h1946h19b5h1ad9h1b0ah1155h) Received: from mail108-co1 (localhost.localdomain [127.0.0.1]) by mail108-co1 (MessageSwitch) id 1365755548797327_12025; Fri, 12 Apr 2013 08:32:28 +0000 (UTC) Received: from CO1EHSMHS010.bigfish.com (unknown [10.243.78.251]) by mail108-co1.bigfish.com (Postfix) with ESMTP id C080088005C for ; Fri, 12 Apr 2013 08:32:28 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS010.bigfish.com (10.243.66.20) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 12 Apr 2013 08:32:27 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.328.11; Fri, 12 Apr 2013 08:32:26 +0000 Received: from localhost (rock.ap.freescale.net [10.193.20.106]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r3C8WO07032187; Fri, 12 Apr 2013 01:32:25 -0700 From: Mingkai Hu To: Date: Fri, 12 Apr 2013 15:53:17 +0800 Message-ID: <1365753197-12162-1-git-send-email-Mingkai.Hu@freescale.com> X-Mailer: git-send-email 1.8.0 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: Mingkai Hu , afleming@freescale.com Subject: [U-Boot] [PATCH] powpc/mpc85xx: explicit cast the SDRAM size to type phys_size_t 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 To avoid sign extension problem, use explicit casting to cast the SDRAM size to type phys_size_t, or else, if the SDRAM size is 2G(0x80000000), it will be extended to 0xffffffff80000000 when phys_size_t is type 'unsigned long long'. Signed-off-by: Mingkai Hu --- Based on master branch of git://git.denx.de/u-boot.git Also can apply direcly to git://www.denx.de/git/u-boot-mpc85xx.git arch/powerpc/cpu/mpc85xx/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c index df2ab6d..ee6fac3 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu.c +++ b/arch/powerpc/cpu/mpc85xx/cpu.c @@ -339,7 +339,7 @@ phys_size_t initdram(int board_type) #if defined(CONFIG_SPD_EEPROM) || defined(CONFIG_DDR_SPD) return fsl_ddr_sdram_size(); #else - return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; + return (phys_size_t)CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; #endif } #else /* CONFIG_SYS_RAMBOOT */