From patchwork Fri Apr 12 08:34:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hu Mingkai-B21284 X-Patchwork-Id: 236006 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 E7A632C00B4 for ; Fri, 12 Apr 2013 20:07:33 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D9C754A021; Fri, 12 Apr 2013 12:07:30 +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 2IUGU6nSPasJ; Fri, 12 Apr 2013 12:07:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 09AAD4A027; Fri, 12 Apr 2013 12:07:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4E14A4A01E for ; Fri, 12 Apr 2013 10:49:37 +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 F9huU8nMjHje for ; Fri, 12 Apr 2013 10:49:36 +0200 (CEST) X-Greylist: delayed 903 seconds by postgrey-1.27 at theia; Fri, 12 Apr 2013 10:49:34 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 ch1outboundpool.messaging.microsoft.com (ch1ehsobe002.messaging.microsoft.com [216.32.181.182]) by theia.denx.de (Postfix) with ESMTPS id 025804A01B for ; Fri, 12 Apr 2013 10:49:34 +0200 (CEST) Received: from mail200-ch1-R.bigfish.com (10.43.68.254) by CH1EHSOBE012.bigfish.com (10.43.70.62) with Microsoft SMTP Server id 14.1.225.23; Fri, 12 Apr 2013 08:34:30 +0000 Received: from mail200-ch1 (localhost [127.0.0.1]) by mail200-ch1-R.bigfish.com (Postfix) with ESMTP id 013A11602E8 for ; Fri, 12 Apr 2013 08:34:30 +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: -2 X-BigFish: VS-2(zz9371I542I4015Izz1f42h1fc6h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ahzz8275bhz2dh2a8h668h839h8e2h8e3h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h1ad9h1b0ahbe9i1155h) Received: from mail200-ch1 (localhost.localdomain [127.0.0.1]) by mail200-ch1 (MessageSwitch) id 13657556687625_1331; Fri, 12 Apr 2013 08:34:28 +0000 (UTC) Received: from CH1EHSMHS032.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.250]) by mail200-ch1.bigfish.com (Postfix) with ESMTP id F055940008F for ; Fri, 12 Apr 2013 08:34:27 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS032.bigfish.com (10.43.70.32) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 12 Apr 2013 08:34:27 +0000 Received: from 039-SN2MPN1-011.039d.mgd.msft.net ([169.254.1.113]) by 039-SN1MMR1-004.039d.mgd.msft.net ([::1]) with mapi id 14.02.0328.011; Fri, 12 Apr 2013 08:34:26 +0000 From: Hu Mingkai-B21284 To: Hu Mingkai-B21284 , "u-boot@lists.denx.de" Thread-Topic: [PATCH] powpc/mpc85xx: explicit cast the SDRAM size to type phys_size_t Thread-Index: AQHON1hD1kSAyPAW40CTJA38mH+egZjSQi8g Date: Fri, 12 Apr 2013 08:34:25 +0000 Message-ID: References: <1365753197-12162-1-git-send-email-Mingkai.Hu@freescale.com> In-Reply-To: <1365753197-12162-1-git-send-email-Mingkai.Hu@freescale.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.193.20.43] MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Mailman-Approved-At: Fri, 12 Apr 2013 12:07:27 +0200 Cc: sun york-R58495 , Fleming Andy-AFLEMING Subject: Re: [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 Please ignore this patch because there's a typo in title "powpc". Thanks, Mingkai -----Original Message----- From: Hu Mingkai-B21284 Sent: Friday, April 12, 2013 3:53 PM To: u-boot@lists.denx.de Cc: Fleming Andy-AFLEMING; sun york-R58495; Hu Mingkai-B21284 Subject: [PATCH] powpc/mpc85xx: explicit cast the SDRAM size to type phys_size_t 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 */ -- 1.8.0