From patchwork Mon Feb 17 06:12:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Durga Prasad Paladugu X-Patchwork-Id: 320851 X-Patchwork-Delegate: monstr@monstr.eu 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 5A8422C00B7 for ; Mon, 17 Feb 2014 17:28:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1B1CD4B6A6; Mon, 17 Feb 2014 07:28:31 +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 L5HYR64+S-7j; Mon, 17 Feb 2014 07:28:30 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 866804B69C; Mon, 17 Feb 2014 07:28:26 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AF30A4B69C for ; Mon, 17 Feb 2014 07:28: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 W273coX09DXq for ; Mon, 17 Feb 2014 07:28:19 +0100 (CET) X-Greylist: delayed 912 seconds by postgrey-1.27 at theia; Mon, 17 Feb 2014 07:28:15 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 am1outboundpool.messaging.microsoft.com (am1ehsobe006.messaging.microsoft.com [213.199.154.209]) by theia.denx.de (Postfix) with ESMTPS id 5EFCE4B69B for ; Mon, 17 Feb 2014 07:28:15 +0100 (CET) Received: from mail30-am1-R.bigfish.com (10.3.201.248) by AM1EHSOBE011.bigfish.com (10.3.207.133) with Microsoft SMTP Server id 14.1.225.22; Mon, 17 Feb 2014 06:13:01 +0000 Received: from mail30-am1 (localhost [127.0.0.1]) by mail30-am1-R.bigfish.com (Postfix) with ESMTP id AB28C3A00A6 for ; Mon, 17 Feb 2014 06:13:01 +0000 (UTC) X-Forefront-Antispam-Report: CIP:149.199.60.83; KIP:(null); UIP:(null); IPV:NLI; H:xsj-gw1; RD:unknown-60-83.xilinx.com; EFVD:NLI X-SpamScore: 1 X-BigFish: VPS1(zzzz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h2189h1d1ah1d2ah21bch1fc6hzz1de098h8275bh1de097hz2fh95h839hc61hd24hf0ah119dh1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1b0ah224fh1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e1dh1e23h1fe8h1ff5h2218h2216h226dh24afh2327h2336h2438h2461h2487h24d7h2516h2545h255eh906i1155h) Received-SPF: pass (mail30-am1: domain of xilinx.com designates 149.199.60.83 as permitted sender) client-ip=149.199.60.83; envelope-from=siva.durga.paladugu@xilinx.com; helo=xsj-gw1 ; helo=xsj-gw1 ; Received: from mail30-am1 (localhost.localdomain [127.0.0.1]) by mail30-am1 (MessageSwitch) id 1392617579623546_12859; Mon, 17 Feb 2014 06:12:59 +0000 (UTC) Received: from AM1EHSMHS015.bigfish.com (unknown [10.3.201.245]) by mail30-am1.bigfish.com (Postfix) with ESMTP id 8A75920023D for ; Mon, 17 Feb 2014 06:12:59 +0000 (UTC) Received: from xsj-gw1 (149.199.60.83) by AM1EHSMHS015.bigfish.com (10.3.207.153) with Microsoft SMTP Server id 14.16.227.3; Mon, 17 Feb 2014 06:12:59 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-smtp1) by xsj-gw1 with esmtp (Exim 4.63) (envelope-from ) id 1WFHRq-00008E-Gp for u-boot@lists.denx.de; Sun, 16 Feb 2014 22:12:58 -0800 From: Siva Durga Prasad Paladugu To: Date: Mon, 17 Feb 2014 11:42:39 +0530 X-Mailer: git-send-email 1.7.4 X-RCIS-Action: ALLOW MIME-Version: 1.0 Message-ID: X-OriginatorOrg: xilinx.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: michals@xilinx.com, Siva Durga Prasad Paladugu Subject: [U-Boot] [PATCH] arm: zynq: correct the argument to lldiv 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 Typecast the argument with unsigned long long for proper calculation of lldiv Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- -Fixes the issue of rounding of the multiplication result to 32-bit value --- arch/arm/cpu/armv7/zynq/timer.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/armv7/zynq/timer.c b/arch/arm/cpu/armv7/zynq/timer.c index 2be253c..09a5547 100644 --- a/arch/arm/cpu/armv7/zynq/timer.c +++ b/arch/arm/cpu/armv7/zynq/timer.c @@ -107,7 +107,8 @@ void __udelay(unsigned long usec) if (usec == 0) return; - countticks = lldiv(TIMER_TICK_HZ * usec, 1000000); + countticks = lldiv(((unsigned long long)TIMER_TICK_HZ * usec), + 1000000); /* decrementing timer */ timeend = readl(&timer_base->counter) - countticks;