From patchwork Thu Apr 8 13:43:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,PATCHv2,02/13] Nomadik: timer: push down single-use macros Date: Thu, 08 Apr 2010 03:43:09 -0000 From: Rabin Vincent X-Patchwork-Id: 71738 Message-Id: <1270734200-17762-3-git-send-email-rabin.vincent@stericsson.com> To: Cc: STEricsson_nomadik_linux@list.st.com, Michael Brandt , Alessandro Rubini Eliminate some single-use macros. USEC_TO_COUNT and COUNT_TO_USEC are replaced in a later patch. Cc: Alessandro Rubini Acked-by: Michael Brandt Signed-off-by: Rabin Vincent --- cpu/arm926ejs/nomadik/timer.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cpu/arm926ejs/nomadik/timer.c b/cpu/arm926ejs/nomadik/timer.c index 1d98ef3..fdab650 100644 --- a/cpu/arm926ejs/nomadik/timer.c +++ b/cpu/arm926ejs/nomadik/timer.c @@ -31,8 +31,6 @@ #define TIMER_CLOCK (24 * 100 * 1000) #define COUNT_TO_USEC(x) ((x) * 5 / 12) /* overflows at 6min */ #define USEC_TO_COUNT(x) ((x) * 12 / 5) /* overflows at 6min */ -#define TICKS_PER_HZ (TIMER_CLOCK / CONFIG_SYS_HZ) -#define TICKS_TO_HZ(x) ((x) / TICKS_PER_HZ) /* macro to read the decrementing 32 bit timer as an increasing count */ #define READ_TIMER() (0 - readl(CONFIG_SYS_TIMERBASE + MTU_VAL(0))) @@ -64,7 +62,8 @@ void reset_timer(void) /* Return how many HZ passed since "base" */ ulong get_timer(ulong base) { - return TICKS_TO_HZ(READ_TIMER()) - base; + ulong hz = READ_TIMER() / (TIMER_CLOCK / CONFIG_SYS_HZ); + return hz - base; } /* Delay x useconds */