From patchwork Thu Dec 5 19:48:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 297377 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 C9C8C2C0090 for ; Fri, 6 Dec 2013 06:48:40 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1B85AB5D9; Thu, 5 Dec 2013 20:48:37 +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 Ds5okDglc+Hu; Thu, 5 Dec 2013 20:48:37 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C093FAB5DA; Thu, 5 Dec 2013 20:48:31 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 71714AB5DA for ; Thu, 5 Dec 2013 20:48:30 +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 d3UxlSTA-su7 for ; Thu, 5 Dec 2013 20:48:25 +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-qa0-f41.google.com (mail-qa0-f41.google.com [209.85.216.41]) by theia.denx.de (Postfix) with ESMTPS id 271A9AB5D4 for ; Thu, 5 Dec 2013 20:48:18 +0100 (CET) Received: by mail-qa0-f41.google.com with SMTP id j5so132247qaq.14 for ; Thu, 05 Dec 2013 11:48:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=q1g+OshMMuXw/mQLtT00d2kJY9I75Qc9GWjxZXnbIvQ=; b=mw8kvTZekqCbRwkJyLD0f/CjImimPghrJza+hJIbLqjdMuas5zPxwdhD2oa/FoQHcF leCQx6RHMlLwkRmj/0Ws9RwLNLsyH8BvghYiT5CAGKQc0JIAQ6P8fdyvMjR0cHOq1DbS o87eZjql+2nCoHWr2Uv3njccTtZI2UBlCv0KlNcUjG75oUMjUZoGNIodcy1fg8naixEm xG7dVgXrzQ/3p/XrR2KfuMDDQVtZc/p1tm2pDJliIROkFieKDAzvCf+zmkDi6TCCNVAF gmw+bSgtmvMSGPYzWy4mPK48N7lEWTkQj1KH4bGHdc4dptnbDvJXMvgjL27ndLnQPz0E SCag== X-Received: by 10.224.24.201 with SMTP id w9mr39950351qab.103.1386272896425; Thu, 05 Dec 2013 11:48:16 -0800 (PST) Received: from localhost.localdomain (cpe-174-106-216-211.ec.res.rr.com. [174.106.216.211]) by mx.google.com with ESMTPSA id g10sm33931689qaf.9.2013.12.05.11.48.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 11:48:15 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Date: Thu, 5 Dec 2013 14:48:35 -0500 Message-Id: <1386272919-22615-1-git-send-email-trini@ti.com> X-Mailer: git-send-email 1.7.9.5 Cc: Nobuhiro Iwamatsu Subject: [U-Boot] [PATCH 1/5] ARM:rmobile: Correct get_time_ms / get_time_us to use 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Cc: Nobuhiro Iwamatsu Signed-off-by: Tom Rini --- arch/arm/cpu/armv7/rmobile/timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/armv7/rmobile/timer.c b/arch/arm/cpu/armv7/rmobile/timer.c index 72e0c12..67a5a7a 100644 --- a/arch/arm/cpu/armv7/rmobile/timer.c +++ b/arch/arm/cpu/armv7/rmobile/timer.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -38,13 +39,12 @@ static u64 get_time_us(void) u64 timer = get_cpu_global_timer(); timer = ((timer << 2) + (CLK2MHZ(CONFIG_SYS_CPU_CLK) >> 1)); - timer /= (u64)CLK2MHZ(CONFIG_SYS_CPU_CLK); - return timer; + return lldiv(timer, CLK2MHZ(CONFIG_SYS_CPU_CLK)); } static ulong get_time_ms(void) { - return (ulong)(get_time_us() / 1000); + return lldiv(get_time_us(), 1000); } int timer_init(void)